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.Font.Bold = True
docBuilder.Font.Bold = False
bookmarks(strBookmarkName).Text = "some text"
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.