A family of Microsoft word processing software products for creating web, email, and print documents.
Use
Dim p As Long
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="Widget1", Forward:=True, _
MatchWildcards:=False, Wrap:=wdFindStop, MatchCase:=True) = True
p = Selection.Information(wdActiveEndPageNumber)
Loop
End With
ActiveDocument.ExportAsFixedFormat OutputFilename:="expanding", ExportFormat:=wdExportFormatPDF, OpenafterExport:=True, OptimizeFor:=wdExportOptimizeForPrint, Range:=wdExportFromTo, From:=p, To:=p