0
votes

Trying to make this macro go through all paragraphs and check if they start with a number, if yes, I'd like it to make all that paragraph Bold. However, nothing happens, not even an error message.

Sub titles()

    For Each Paragraph In ActiveDocument.Paragraphs
        If IsNumeric(Paragraph.Range.Words(1).Characters(1)) = True Then
            wcount = Paragraph.Range.Words.Count
            Paragraph.Range.Words(wcount).Font.Bold = True
            'MsgBox (wcount)
        End If
    Next Paragraph

End Sub
1

1 Answers

3
votes

This:

Paragraph.Range.Words(wcount).Font.Bold = True

will just bold the last "word". Try:

Paragraph.Range.Font.Bold = True