View Single Post
 
Old 03-20-2024, 01:25 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Yes I am sure that such a macro exists, or could be written. We (or at least most of the regulars) are not here as a free macro writing service. We are here to help others learn VBA. You have made no apparent effort write this procedure yourself or search for one online.


This should get you started:
Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
   Set oRng = ActiveDocument.Range
   With oRng.Find
     .Style = "Heading 2"
     While .Execute
       MsgBox oRng.Text & oRng.Information(wdActiveEndPageNumber)  
     Wend
   End With
lbl_Exit:
   Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote