Bookmark selection removal
Posted: Fri Apr 26, 2013 5:09 pm
Hi,
Currently I'm using the Docx4j API to modify the word template and has one query regarding bookmark contents.
I've huge word template (414 pages) with many bookmarks in it. I can remove all the bookmarks using BookmarksDeleter sample.
Now I have to remove corresponding selection of bookmark. Modification/String manipulation of document.xml was not feasible as bookmarks span across paragraphs.
If using ACTIVE X, it is achieved via below code:-
myDocument.Bookmarks(deleteBookMarkName).Select();
myDocument.Application.Selection.Delete();
I was looking for similar kind of selection and deletion of bookmark content was possible in docx4j.
Thanks,
Chethan
Currently I'm using the Docx4j API to modify the word template and has one query regarding bookmark contents.
I've huge word template (414 pages) with many bookmarks in it. I can remove all the bookmarks using BookmarksDeleter sample.
Now I have to remove corresponding selection of bookmark. Modification/String manipulation of document.xml was not feasible as bookmarks span across paragraphs.
If using ACTIVE X, it is achieved via below code:-
myDocument.Bookmarks(deleteBookMarkName).Select();
myDocument.Application.Selection.Delete();
I was looking for similar kind of selection and deletion of bookmark content was possible in docx4j.
Thanks,
Chethan