I was googling yesterday trying to find the answer to my question but couldn’t find a solution. Perhaps I am not describing my problem correctly.
I’m trying to insert specific text at a given bookmark named “bmk_condition”. The text consists of a condition number, a description, and a deadline (if available). As shown in the image below, I want the condition and its number (e.g., Condition 2) to be in bold, while the rest should be in normal text.
From what I gathered on various forums, I need to set the bookmark.range.font.bold property. However, my “Condition ..” text remains unformatted.
Here is a sample of my code (data extraction part is omitted for brevity):
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim wdBmk As Word.Bookmark
Set wdApp = GetObject(, "Word.Application")
wdApp.Visible = True
wdDoc.Activate
Set wdBmk = pWdDoc.Bookmarks("bmk_condition")
wdBmk.Range.Collapse Direction:=wdCollapseStart
'Insert condition #2
wdBmk.Range.Font.Bold = False
wdBmk.Range.Text = "Lorem Ipusm" & vbCrLf & "Deadline: xxxxxx"
wdBmk.Range.Font.Bold = True
wdBmk.Range.Text = "Condition 2"
'Insert condition #1
wdBmk.Range.Font.Bold = False
wdBmk.Range.Text = "Lorem Ipsum"
wdBmk.Range.Font.Bold = True
wdBmk.Range.Text = "Condition 1"
Despite setting the font.bold property, the text does not appear bold. Any insights or suggestions on what might be going wrong?
Thank you in advance for your help.