From: Willken on 6 Feb 2010 22:44 How do I print the search results from Word that includes the page number for each search result. Does anyone know a macro or does Microsoft Words have the option?
From: Graham Mayor on 7 Feb 2010 02:38 The following macro will write the page number(s) of each occurrence of the searched text to a new document. Dim oDoc, oNewdoc As Document Dim sText, sPage As String sText = InputBox("Enter text to find") Set oDoc = ActiveDocument Set oNewdoc = Documents.Add oNewdoc.Range.Text = "'" & sText & "' found on page(s) " oDoc.Activate Selection.HomeKey wdStory Selection.Find.ClearFormatting With Selection.Find Do While .Execute(findText:=sText) = True oNewdoc.Range.InsertAfter _ Selection.Information(wdActiveEndPageNumber) & ", " Loop End With oNewdoc.Activate http://www.gmayor.com/installing_macro.htm -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<> "Willken" <Willken(a)discussions.microsoft.com> wrote in message news:53125B75-48D9-429D-8E7D-587F955158E7(a)microsoft.com... > How do I print the search results from Word that includes the page number > for > each search result. Does anyone know a macro or does Microsoft Words have > the > option?
From: Willken on 7 Feb 2010 10:45 WHOOPEE! You are the best
|
Pages: 1 Prev: Print Preview Zoom option Next: what is the advantage of using the overtype feature? |