Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Exception
SAException
SAException

BookmarksToRemove will throw this exception if a bookmark in the list has been set as a Repeat Block

Exception
NullArgumentException
NullArgumentException

...

BookmarksToRemove

...

will throw this exception if bookmarks is null.

Remarks

This feature is available in OOXML files (DOCX/DOCM) only.

Removing a bookmark will remove anything that is inside that bookmark.

Example
Code Block
csharp
csharp
titleC#

WordTemplate wt = new WordTemplate();
wt.Open(@"c:\templates\Template.docdocx");
string [] bookmarks = {"Bookmark1", "AroundTable"};
wt.BookmarksToRemove(bookmarks);
wt.Process();
wt.Save(@"c:\reports\Report.docdocx");
Code Block
vb.net
vb.net
titlevb.net
//--- Set "Author" Property
Dim wt As New WordTemplate()
wt.Open("c:\templates\Template.docx")
Dim bookmarks = New String() {"Bookmark1", "AroundTable"};
wt.BookmarksToRemove(bookmarks);
wt.Process()
wt.Save("c:\reports\Report.docx")