Solved

MS ACCESS 2007/adobe acrobat

Posted on 2013-01-29
4
497 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
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

The Adobe PDF proprietary file format is recognized as secure and formulated. But these PDF files are also prone to corruption and any external threat like virus attacks, improper storage can hit PDF file integrity.This type of damages can make cruc…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

815 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

9 Experts available now in Live!

Get 1:1 Help Now