Question Return Bold content of word doc

topsykretts

Well-known member
Joined
Dec 22, 2011
Messages
47
Programming Experience
Beginner
Hello to all,
It has been a long time since I have posted my last post.
I would like to ask for the help, to locate and return the bold content of the text from word file.Text that I would like to return is placed somewhere on the only one page and it is the only text which font is bold. It is a piece of row which text font is bold.

Here is what I have tried:
VB.NET:
With oDoc.Content.Find
            If .Font.Bold = True Then
                'MsgBox()
            End If
End With

Any help is very appreciated.
 
try this:
VB.NET:
Dim rng = doc.Content
With rng.Find
    .Font.Bold = True
    .Execute()
    If .Found Then
        Debug.WriteLine(rng.Text)
    End If
End With
 
Back
Top