Solved

MS ACCESS 2007/adobe acrobat

Posted on 2013-01-29
4
485 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
  • 2
4 Comments
 
LVL 84
Comment Utility
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
Comment Utility
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
Comment Utility
I have adobe 9 pro
0
 
LVL 44

Accepted Solution

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now