• Need VBA code to open PDF file and strike one word

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Need VBA code to open PDF file and strike one word

    Author
    Topic
    #504147

    Hi Experts,
    I am bit unsure if this is possible or not? I have list of PDF files saved in a folder. Is it possible with VBA code to open each file and search for a word and strike it?
    Regards,
    JD

    Viewing 4 reply threads
    Author
    Replies
    • #1548397

      Do you want to modify the PDF file or collect some details from the PDF and add it to a spreadsheet? Either way I expect you will need to use Word to open the PDF.

      cheers, Paul

    • #1548403

      Hi Paul,

      I need to modify the PDF file. In short it should work in a way where each PDF should open and specific word gets strike. I find one link – http://www.vbaexpress.com/forum/showthread/?1554-HELP!!!-ABOUT-PDF-FILE. This is somewhat closed to my requirement. I am not able to run it, because I am not sure which reference I have to select from the tool option.

      Regards,
      JD

      • #1548512

        I need to modify the PDF file. In short it should work in a way where each PDF should open and specific word gets strike. I find one link – http://www.vbaexpress.com/forum/showthread/?1554-HELP!!!-ABOUT-PDF-FILE. This is somewhat closed to my requirement. I am not able to run it, because I am not sure which reference I have to select from the tool option.

        As indicated in the link, you need to add a reference to the Acrobat Library, which you do via Tools|References in the VBE of whichever application you want to use. You can only do that if you have Adobe Acrobat Pro installed.

        Adobe Acrobat Pro 8 is available as a free download (see: http://www.techspot.com/downloads/4683-adobe-acrobat-8-free.html – note the serial# mentioned there). Updates, to bring it up to 8.3.1 are available from: ftp://ftp.adobe.com/pub/adobe/acrobat/win/8.x/

        Note 1: If you install the updates, you need to install them in order (8.1.0>8.1.1, etc.) and, although three of them will prompt to reboot, you don’t need to do so until all of the updates are installed. Your AV software may also mis-identify a print spooler in the last few updates as potential viruses – just tell it to accept them as legit.

        Note 2: If you want to use Adobe Acrobat Pro 8 as a Print Driver, you’ll need to go to Start>Devices and Printers>Adobe PDF>Right-Click>Printer Properties>Advanced, then click the ‘Print Directly to Printer’ radio button.

        Cheers,
        Paul Edstein
        [Fmr MS MVP - Word]

        • #1548663

          Hi Macro,

          Thanks for providing the above information on the Adobe. I checked the version which is installed in my PC and it is Adobe Reader XI. I think it is a basic one and not the pro one. Please let me if it is useful to run the macro via excel. I have selected following references from the tool|Reference option.
          • Acrobat Access 3.0 type library
          • Adobe Acrobat 10.0 type library
          • Adobe acrobat Browser control type library 1.0
          • Adobe Reader File Preview Type Library
          Regards,
          JD

    • #1548408

      Just a note about .pdf files, many times they will be protected from being edited by others than the creator/author. That was one of the features when Adobe Acrobat was created for the purpose of sharing documents. There’s a number of such features available in Acrobat such as allowing or disallowing printing or other things, can allow only reading.

      Before you wonder "Am I doing things right," ask "Am I doing the right things?"
    • #1548511

      I don’t have Office to test, so you’ll have to wait for someone else to advise.

      cheers, Paul

    • #1548689

      The Reader versions are not sufficient – you need a Pro version – and the Library’s name is just ‘Acrobat’.

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    Viewing 4 reply threads
    Reply To: Need VBA code to open PDF file and strike one word

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: