View Single Post
 
Old 03-31-2014, 02:54 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For a different way of approaching the problem, try something along the lines of:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim StrOut As String
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ""
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = True
    .Font.Bold = True
    .MatchWildcards = False
    .Execute
  End With
  Do While .Find.Found
    StrOut = StrOut & vbCr & .Text
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
While InStr(StrOut, vbCr & vbCr) > 0
  StrOut = Replace(StrOut, vbCr & vbCr, vbCr)
Wend
Application.ScreenUpdating = True
MsgBox "The document contains the following bold text:" & StrOut
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote