print the search results in Word

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 
2/7/2010 3:44:02 AM
word.docmanagement 5542 articles. 1 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 29

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) "
Selection.HomeKey wdStory
With Selection.Find
    Do While .Execute(findText:=sText) = True
        oNewdoc.Range.InsertAfter _
        Selection.Information(wdActiveEndPageNumber) & ", "
End With

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site
Word MVP web site
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

"Willken" <> wrote in message
> 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? 

2/7/2010 7:38:18 AM
WHOOPEE! You are the best

2/7/2010 3:45:01 PM

Similar Artilces:

Office Apps Quit When Trying to Print
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have an HP DeskJet845c which I have loved -- until now. Every time I try to print from any apps in the Office 2008 suite, I get a pop-up msg saying that "[app name] has encountered an error and needs to close. We are sorry for the inconvenience." I've downloaded and re-installed the latest HP driver for this printer (which supposedly is also included w/ OS X.5) but to no avail. The only thing I can think of is to delete any HP printer drivers that may be installed and do a clean install of the driver for ...

Rules based attachment printing
Is there any way we can specify to print the attchments also with the email while setting up a rule for autoprint? ...

printing gray
I cn no longer get my black and white printer to print anything but black and white. Yesterday I was capable of printing shades of gray, but I must have changed something because if I have a black and white printer selected, I can see nothing but black and white, even on the print preview screen. If I change my printer to a color printer, print preview will display the gray color and print properly, but if I have a black and white printer selected I can't Read your printer manual. It's certainly not a Publisher issue. Oops "Read" is a four letter word. >-----Origina...

Shape search won't work
Hi, I am using Visio 2003 standard (dutch) and I am not able to find any of my shapes through the search option. It does not find any of my shapes, even if they are in a stencil right below this search field. I have added the right path to my stencils in the Visio properties, but without any result. What could be the matter here ? Thanks, Arnold de Greef There are a couple things to try: 1. Make sure you are searching for keywords in your shapes (in the Master Properties dialog). Search does not find shapes by name. To find this drop the shape on the page, then do File > Shapes...

Manual Duplex Printing
Does Excel XP have a provision for manual duplex printing as Word XP does? Right now I do the Print page 1 and then 2 and then ... Office XP, XP Home, HP-970 Cse. My HP duplex printing module has gone out on me hence the question. -- "The two highest achievements of the human mind are the twin concepts of "loyalty" and "duty". Whenever these twin concepts fall into disrepute -- get out of there fast! You may possibly save yourself, but it is too late to save that society. It is doomed." ...

create Excel hyperlink to a PAGE in Word
I would like to create an Excel hyperlink to a specific page in a Word document. Anyone know how to do this or if it is possible? Thanks! You could create a bookmark in the Word Document. (Click in the Document, then go to Insert | Bookmark.) Then, in Excel put this at the end of the Hyperlink info: #bookmark_name Here's a generic version of it: C:\MoreFolders\FileName.doc#bookmark_name tj "stefani13" wrote: > I would like to create an Excel hyperlink to a specific page in a Word > document. Anyone know how to do this or if it is possible? Thanks! I tried that,...

How do I print my diagram that will show me my lines. When I go to preview I see the lines and the pictures but when I print it some of the lines come out and some does not. When I go to preview it look like they are divided into cells so how do I remove the cells so the entire picture with lines will print? ------=_NextPart_0001_60BEA2F8 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, It looks like you have a drawing bigger than the printer page. So in the preview you see that it would print into tiles To get the entire drawing on a page, from File Menu > Page Setup >...

How do I make and print 3x5 address cards?
I was in the wrong area when I asked this before. I am new at this and trying to figure out how to make a list of names, addresses, phone numbers, etc., that I can then print on 3x5 index cards. I want to be able to keep the information in my computer, but be able to print out cards to look it up if I'm not on the computer or to give to my sons who use Mac's instead of PC's. I figured someone had made a template for how to do this, but I haven't been able to find it. I have Office 2003 with Word, Excel, Outlook, and PowerPoint. Can anyone help me? Thanks. You don...

Printing emails really small
Hi My Outlook 2k3 prints single page emails fine, but If i try to fit one which is over 1 page - it shrinks to fit - making it unreadable. Shrink to fit is not enabled and I'm printing on a networked printer. The owner of the workstation that the printer is hooked up to has no problem. It was fine yesterday! Can anyone point me to the appropriate setting for stopping this behaviour? K ...

Re: Opening Windows Explorer Search window from Excel
Does anybody know how I can open the Explorer search window using VBA? thank you --- Message posted from MTBer, Well, you could do this without VBA by Linking a cell to a URL. However, not being a VBA guru I was successful with the following: Private Sub URL_Click() Range("E20").Select Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True End Sub Cell E20 contains the desired Hyperlink executed by the Private Sub. -- Regards... "MTBer >" wrote: > Does anybody know how I can open the Explorer search window ...

Printing a form from excel
Can anyone help with this please, I have a form set up with everything working in the various fields. But I want to print out numerous pages with the value of a single cell increasing by one on each sheet printed. can anyone give me the formula to do this as I am in over my head now. Thanks hopefully. How about a macro? Option Explicit Sub testme() Dim myCell As Range Dim wks As Worksheet Dim iCtr As Long Set wks = Worksheets("sheet1") With wks Set myCell = .Range("a1") 'whatever cell you need If IsNumeric(myCe...

how can i print one tile of a poster in publisher
I have printed a poster of which one tile is misaligned. Can you print just one tile ie number 4? On Fri, 11 Nov 2005 11:03:05 +0000, crystaltips wrote (in article <>): > I have printed a poster of which one tile is misaligned. Can you print just > one tile ie number 4? Nothing whatsoever to do with Publisher this is a feature of your printer settings. If your printer can't do it then, no, you can't. A workaround, create white rectangles over the parts you do not want printed, give them no line. Look at the prin...

print pre-printed forms
Is the any way to use excel to print pre-printed forms ( invoices , etc ) after all datas are entered? Is there any way to design a template for that ? Tks !! Osvaldo Osvaldo I take it that you have a printed form to start with, and you want to put this printed form in the printer and have Excel fill in the blanks. Is that right? You can write a macro to do this but it will be a lot of trial and error to get the code to place the data in the blank spaces correctly. It would be much easier if you design the form in Excel first, then have Excel fill it in with a macro, then have...

logo printing from gp
Hi, Is there a way to print the company logo for multiple companies on a single (report writer) report? eg. printing an invoice from company A will print the logo for company A, while printing the same invoice for company B will print the logo for company B. This refers specifically to RM invoices and not SOP (where its possible to do this with the different forms). Also, I am aware that this may be possible from Crystal and even using multiple reports dictionaries - but was just wondering if there is a simple way to get this out of GP and one reports.dic? Ritesh Maharaj Hi Rites...

Search Folders #2
Is there a way to get search folders in Outlook2003 to search subscribed IMAP folders? ...

Subject line shows the word spam
When I send an email to anyone, the subject line of the email they receive always shows the word SPAM. I don't add it. Where does it come from and how would I get rid of it? Thanks It's probably coming from their spam software. Ask them to add you to their "safe senders list." -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers "joe" <> wrote in message news:630301c474f9$98001f00$a501280a@phx.gbl.....

Printing a bitmap
Hi, I'm trying to print out a bitmap using the document/view architecture of MFC. The bitmap looks pretty good on my view class, but does not on the preview window. Can anyone help? The section of the OnDraw function of the view class looks like this void myViewClass:OnDraw(CDC* pDC) { .... CBitmap bitmap; CDC dcMemory; bitmap.LoadBitmap(IDB_BITMAP_GMBH); dcMemory.CreateCompatibleDC(pDC); dcMemory.SelectObject(&bitmap); CSize bitSize(117, 96); pDC->DPtoLP(&bitSize); pDC->StretchBlt(nHeaderTextMid -, -720,, -bitSize...

how do I find an average number of specific words in a column
I am attempting to calculate a number of specific word occurrences. In example, I have a column with yes in certain cells, and no in the others. How can I display the total number of yes and no occurrences? I am fairly new to Excel and know very little about coding in it. Hi you can use the countif function to return the numbers of "yes" and "no" e.g. =COUNTIF(A1:A100,"yes") will count the number of "yes" answers in the range A1 to A100 likewise, =COUNTIF(A1:A100,"no") will count the number of "no" answers in the same range H...

Recover lost text from a word document
I've been working for 2 days on a document, saving it frequently. I just realized that part of the document must have been highlighted, then deleted, and of course I saved it. I have Vista and MS Word 2003. I've checked online and found a couple of ways that was told would work, but nothing so far has worked for me. One way was to check 'Confirm conversion at open', but that didn't work... nothing came up when I opened the document. Can anyone help, I'm really desperate! Thanks! Jenny Don't close the document; Undo the deletion. On Ap...

Print Help Files
When I click on help in an application about 40 folders show up. I want to print them all to get a user guide. I can print each folder one at a time with all the folder's contents, but that's a very time consuming process. Is there any way I can print all 40 folders with their contents with one print command? Bob Speck I use to use HLP2RTF many years ago. Do a search for it. ....Alan -- Alan Edwards, MS MVP Windows - Internet Explorer On Mon, 19 Apr 2010 16:35:32 -1000, in microsoft.public.windowsxp.general, Bob Speck <bobspeck@...

printing labels - using Avery # - not lining up
Using Word 2007 - running windows XP - labels are not lining up - is there some adjustment/calibration to do somewhere to get the labels to print correctly? 1. You have added a header/footer to normal.dotm (rename normal.dotm) 2. The page size set in the printer properties doesn't match the page size of the label sheet. 3. You have a scaling option set in the zoom section of the print dialog 4. Your printer has poor paper handling. Some printers will slip when faced with label stock and thus are incapable of feeding the label correctly. Cleaning the rollers in the print path...

Word unexpectedly quits
Version: 2004 Operating System: Mac OS X 10.4 (Tiger) Processor: intel I've been using Office for Mac nearly a year. Applications have unexpectedly quit before (mainly safari) though not very often. Today Word quit unexpectedly several times, after trying to insert bullets. I think this may have something to do with a list style which I added to the list of established styles, so that it would be available in all word documents I opened. Any suggestions? Hi, Have you installed the latest update that was released today for Office 2004? Also, have you installed the latest update for Mac...

print worksheet group in color
I'm selecting a group of worksheets to print together, and want to print all of the worksheets in color. I specify on the printer dialog to print in color, however, only the first page actually prints in color. Inpage setup - sheet - print, black and white is not selected. Any thoughts? May be a printer issue? ...

Windows 7 64bit, Outlook 2007 and Word 2007 Email attachment issue
Windows 7 64bit, Outlook 2007 and Word 2007 Email attachment issues. When I try to attach a word document to an email I get the error: Word has encountered a problem. There is a problem saving the file. Usually this is because the disk or floppy disk is too small for the file oris full, Ram memory is low, or there is a permission prblem witht he drive the file is being saved to. I can just close the error message and keep working and everything works fine, but it will come up everytime I attach a Word Document. I have tried the following to fix this with no success: 1) Mad...

Printing or Not Printing Pictures
Using Access 2007. This may not be the best approach but this is what I have done... I am trying to create a home inspection database. In my table for bathroom I have the following fields referring to pictures: TPic as an Attachment to add pictures of a toilet (don't laugh!); SPic for sink; VHPic for Venting/Heating; BTPic for bath-tub; SHPic for Shower..... On the form for each area (I have the form set-up as pages / tabs) each attachment field is on the applicable page. That works fine. The user can add as many pictures as they want easily. I can put the attachment...