Separate Bookmarks into individual PDFs using Outlook and VBA RRS feed

  • Question

  • Hi,

    I receive weekly PDF files as an Outlook attachment containing information about each manager as a separate bookmark in the file. The file has about twenty bookmarks. Would like to run a VBA script on the attached file and create a separate PDF file from each of the bookmarks and send it separately to the appropriate manager. The bookmarks are labeled with the manager’s name for mailing. Is this doable? Any help in getting started would be appreciated.

    Thursday, July 27, 2017 11:14 PM

All replies

  • Frankly you are making a rod for your own back by trying to process PDF files, which were never designed to be processed as documents, especially using VBA. Adobe may have the means to do it, but you would have to ask them.

    You could open the PDFs in Word 2013 and later, if they contain editable text, but the bookmarks may not be preserved in the conversion process, and the formatting, if relevant, may also not be preserved. If that is a possibility then you could probably do that using VBA, but without access to the PDF there is no point speculating.

    It would make much more sense for the sender to send you the document, from which the PDF was created, which would be much easier to deal with. Even better get the sender to split it into individual PDFs at source. They could, for example use Or if there were multiple pieces of information for each manager then could help. Both will create individual PDFs as part of a merge process and the latter will e-mail them also, but it needs its data to be in an Excel worksheet.

    Graham Mayor - Word MVP

    Saturday, July 29, 2017 7:27 AM
  • Adobe Acrobat Pro ($$$) has a COM interface that you can access from VBA.  I know they have a way to insert bookmarks so I assume they have a way to extract bookmarks.   I used it around 2005 for PDF manipulation.  Very powerful but it has an expensive license.

    'Initialize Acrobat by creating App object     Set PDFApp = CreateObject("AcroExch.App")

    There is a free tool that you can use with Python to extract info from PDFs, PeePDF.

    Saturday, July 29, 2017 7:57 PM