Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Wiki Markup
{introducedin: 8.4

...

Description

Excerpt

Sets a list of bookmarks to be removed from the document.

Signature
C#C#
}{description}
{excerpt}Sets a list of bookmarks to be removed from the document.{excerpt}
{signature:C#}
 public void BookmarksToRemove(string [] bookmarks)
Signature
{signature}{signature:vb.net
vb.net
}
Public Sub BookmarksToRemove(bookmarks as string())
Parameters

...

An array of strings containing the names of all the bookmarks to be removed

Exceptions

...

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

...

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.

{signature}
{parameters}
{param:bookmarks}An array of strings containing the names of all the bookmarks to be removed{param}

{exceptions}
{exception:SAException}{{BookmarksToRemove}} will throw this exception if a bookmark in the list has been set as a [Repeat Block|WordTemplate.SetRepeatBlock]{exception}
{exception:NullArgumentException}{{BookmarksToRemove}} will throw this exception if {{bookmarks}} is null.{exception}


{remarks}
*This feature is available in OOXML files (DOCX/DOCM) only.*

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

{remarks}
{example}
{code:csharp|title=C#}

WordTemplate wt = new WordTemplate();
wt.Open(@"c:\templates\Template.docx");
string [] bookmarks = {"Bookmark1", "AroundTable"};
wt.BookmarksToRemove(bookmarks);
wt.Process();
wt.Save(@"c:\reports\Report.docx");
{code}

{code:vb.net
|title=vb.net
}
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")
{code}

{example}

Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle