Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-28-2014, 10:27 AM
gmaxey gmaxey is offline Need Help Creating Macro Windows 7 32bit Need Help Creating Macro Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,652
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help Creating Macro Creating a macro button in powerpoint Sammie0Sue PowerPoint 1 12-06-2013 05:51 AM
Need Help Creating Macro Creating a generic macro? suerose Word 2 07-04-2011 07:59 PM
Need Help Creating Macro Creating macro to convert/print to pdf shabbaranks Word 3 05-18-2011 08:59 AM
Creating a MACRO Nikb3522 Word VBA 0 10-21-2010 05:55 PM
creating macro steveb Word VBA 0 08-14-2010 01:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2026 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft