Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 531
  • Last Modified:

MS ACCESS 2007/adobe acrobat

How do I save a pdf file that has bookmarks into a pdf file with no bookmarks? I would like to write a routine in VBA.
0
centralmike
Asked:
centralmike
  • 2
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
VBA has no way to interact directly with Adobe. You can use the Adobe SDK, or a third party utility to work with a PDF, but that's about it.
0
 
Karl Heinz KremerCommented:
Actually Adobe Acrobat has an API for VBA - the IAC or Interapplication Communication Interface. You do need the full version of Acrobat to use most of the features. Which version of Acrobat do you have? With that information I can provide some sample code that would remove the bookmarks from a document.
0
 
centralmikeAuthor Commented:
I have adobe 9 pro
0
 
Karl Heinz KremerCommented:
The following code is a button handler that loads a PDF file, removes the bookmarks and then saves the modified file:

Private Sub CommandButton1_Click()
    Dim AcroApp As Acrobat.CAcroApp
    
    Dim theDocument As Acrobat.CAcroPDDoc
    Dim bm As Acrobat.AcroPDBookmark
    
    Dim thePath As String
    
    thePath = "C:\Users\Karl Heinz Kremer\Desktop\bookmark.pdf"
        
    Set AcroApp = CreateObject("AcroExch.App")
    Set theDocument = CreateObject("AcroExch.PDDoc")
     
    theDocument.Open (thePath)
    
    Set bm = CreateObject("AcroExch.PDBookmark")
    
    If bm.GetByTitle(theDocument, "") Then
        MsgBox ("Found Bookmark")
        bm.Destroy
        If theDocument.Save(PDSaveIncremental, "") = False Then
            MsgBox ("Cannot save the modiifed file")
        End If
    End If
    
    theDocument.Close
     
    AcroApp.Exit
    Set AcroApp = Nothing
    Set theDocument = Nothing
    Set bm = Nothing
     
    MsgBox "Done"
End Sub

Open in new window


To learn more about the IAC interface, you need to review the relevant documents in the Acrobat SDK:

http://www.adobe.com/devnet/acrobat/overview.html

http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?href=JS_Dev_Overview.71.1.html&accessible=true
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now