Hi,
I have the following code:
Dim doc As Document = New Document(word_templates_path & strTemplate)
Dim docBuilder As New DocumentBuilder(doc)
Dim bookmarks As Bookmarks = doc.Range.Bookmarks
Dim strBookmarkStyle As String = "Bold"
Dim strBookmarkName As String = "Bookmark1"
If Not bookmarks(strBookmarkName) Is Nothing Then
If strBookmarkStyle = "Bold" Then
docBuilder.MoveToBookmark(strBookmarkName)
docBuilder.Font.Bold = True
Else
docBuilder.Font.Bold = False
End If
bookmarks(strBookmarkName).Text = "some text"
End If
Assume that the document has a bookmark named “Bookmark1”. I am trying to insert the string “some text” at Bookmark1 and have it appear bold. The text is inserted successfully, but is not bolded. Is there anything I am missing or doing wrong?
Thanks for your help.
C.