+ Reply to Thread
Results 1 to 2 of 2

Excel 2010 VBA code to search for cell values in Word document and print the page to pdf

  1. #1
    Registered User
    Join Date
    04-22-2013
    Location
    Overland Park, KS
    MS-Off Ver
    Office 2010
    Posts
    12

    Post Excel 2010 VBA code to search for cell values in Word document and print the page to pdf

    I have an Excel 2010 file that contains a list of invoice numbers. I am trying to loop through these invoice values one at a time to search for the value in a related Word 2010 document. Once the page is located, I need to print that page to/save that page as a PDF file and then move to the next value (the list will contain one to many invoice numbers.)

    I have searched the forums (both Word and Excel VBA) and the internet, but have been unable to locate exactly what I am looking for. Most of the results I found deal with mail merge or replacing the values once they are found in Word. I don't want to replace anything, only locate the page and print the current page (will be a one-page document).

    The pdf files can be stored in the same location as the original files. (both the Excel and Word documents have the same name and are in the same file folder; the Excel is .xlsx and the Word is .docx file extension.)

    Any assistance would be appreciated. Thanks.

    Kevin

  2. #2
    Registered User
    Join Date
    04-22-2013
    Location
    Overland Park, KS
    MS-Off Ver
    Office 2010
    Posts
    12

    Re: Excel 2010 VBA code to search for cell values in Word document and print the page to p

    I have been able to locate additional information on what I am trying to do with Word. It sounds like I need a process to cycle through the 11 different ActiveDocument.StoryRanges to locate my search string. I have found multiple examples of using the different StoryRanges, but have not been able to find the correct combination of holding the searched value to be able to print that current page to PDF. Any assistance would be appreciated. Thanks in advance.

    Kevin.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Print current page with active cell with VBA code Excel 2010
    By ruznemat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2017, 08:42 AM
  2. VBA code to merge text file in a word document and print all the letters automatically
    By Rajbrinder in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2013, 08:25 AM
  3. Print off the word document using excel vba code
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2013, 09:42 AM
  4. vba code to search text in a word document header and footer
    By Excel-o-ratoR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2012, 03:16 AM
  5. Automating Word - Print one page not entire document!
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2005, 03:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1