Solved

MS ACCESS 2007/adobe acrobat

Posted on 2013-01-29
4
505 Views
Last Modified: 2013-02-15
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
Comment
Question by:centralmike
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 85
ID: 38833138
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
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 38833792
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
 

Author Comment

by:centralmike
ID: 38833807
I have adobe 9 pro
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 38835234
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question