Thread: [Solved] Need Help Creating Macro
View Single Post
 
Old 03-28-2014, 10:27 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Here is one way:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
Dim lngIndex As Long
 Set oRng = ActiveDocument.Range
  For lngIndex = 2 To 150
    With oRng.Find
      .Text = lngIndex & ". "
      .Font.Bold = True
      While .Execute
        oRng.MoveStart wdCharacter, -1
        oRng.Characters(1) = vbCr
        oRng.Collapse wdCollapseEnd
      Wend
    End With
  Next lngIndex
  Set oRng = ActiveDocument.Range
  With oRng.Find
      .Text = " [abcd]."
      .MatchWildcards = True
      While .Execute
        oRng.Characters(1) = vbCr
        oRng.Collapse wdCollapseEnd
      Wend
    End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote