praveenrsmart
praveenrsmart

Reputation: 89

Check if paragraph font style is italic or not?

I want to find if a paragraph is italics or not, i am iterating to all paragraph through a for loop, if the paragraph is italics i want to do some operation.

For Each oPara In .Paragraphs
    With oPara
      If oParaAttrItalic = True Then
          .Style = "new_style"
      End If
    End With
Next

Upvotes: 2

Views: 1161

Answers (1)

Dave
Dave

Reputation: 1643

You need to use the Paragraph.Range reference

Dim oPara As Paragraph

For Each oPara In ActiveDocument.Paragraphs
    If oPara.Range.Font.Italic = True Then
        'Do something
    End If
Next oPara

Upvotes: 1

Related Questions