Consulting

Results 1 to 3 of 3

Thread: Solved: Bold first and last sentence in each paragraph

  1. #1
    VBAX Newbie
    Joined
    Nov 2005
    Posts
    2
    Location

    Solved: Bold first and last sentence in each paragraph

    Is there a way to go through each paragraph in word document and bold the first and last sentences?


    Thanks in advance!
    E

  2. #2
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    [vba]Sub FirstLastBold()
    Dim oSentence As Word.Sentences
    Dim oPara As Word.Paragraph
    For Each oPara In ActiveDocument.Range.Paragraphs()
    Set oSentence = oPara.Range.Sentences
    oSentence(1).Font.Bold = True
    oSentence.Last.Font.Bold = True
    Set oSentence = Nothing
    Next
    End Sub[/vba]
    will bold the first and last sentences of each paragraph.

  3. #3
    VBAX Newbie
    Joined
    Nov 2005
    Posts
    2
    Location

    Works!

    Works like a charm! Thanks for the quick help.

    eripple

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •