Solved

Using Access to assign Bookmarks in a PDF Report

Posted on 2013-11-23
8
1,398 Views
Last Modified: 2013-12-04
I have a report that I use to generate pdf checklists and I'd like to assign bookmarks to easily go to the appropriate checklist

there is a unique header at the beginning of each checklist.

Is there a simple way to do this in the Access vba process that generates the report

A web search bore no fruit

Thanks
0
Comment
Question by:rogerdjr
  • 4
  • 2
8 Comments
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39671818
In general, you need to use a 3rd party method to work with a PDF file to that level. If you have the necessary Adobe components, you can use their SDK, or there a a utilities out there you can automate from Access to do this.
0
 

Author Comment

by:rogerdjr
ID: 39684408
Well it was worth a try thanks
0
 
LVL 84
ID: 39684929
So why the C grade, without any request for additional information? I gave you a few options and would be glad to help you explore them further. Or you can just Delete the question instead of awarding the lowest possible grade you can give ...
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Assisted Solution

by:rogerdjr
rogerdjr earned 0 total points
ID: 39685416
I went on line and found this solution -


I went on line and found this solution - I was hoping for a bit more of a solution from the Experts Exchange, but your was the only response and I got an email from the administrator that my "question needed attention" - what grade should I have given?

http://answers.microsoft.com/en-us/office/forum/office_2003-access/include-a-bookmark-in-an-access-report-so-pdf-will/7f8d45a8-503a-476a-b43d-c4aa4cbd5e67

Function AddBookmarks(strPDFPath As String, blnIncludeCoverTOC As Boolean) As Boolean
     Dim gApp As Object
     Dim gPDDoc As Object
     Dim jso As Object
     Dim BMR As Object
     Dim intWithCover As Integer
     Dim x As Integer
     Dim varBMName As Variant
     Dim varBM As Variant
     Dim rst As DAO.Recordset
     Dim strSQL As String

On Error GoTo Errors
     strSQL = "SELECT tbltmpTableOfContents.ReportCaption, Min(tbltmpTableOfContents.PageNumber) AS Pg " & _
                     "FROM tbltmpTableOfContents " & _
                     "GROUP BY tbltmpTableOfContents.ReportCaption " & _
                     "ORDER BY Min(tbltmpTableOfContents.PageNumber);"
     Set rst = CurrentDb.OpenRecordset(strSQL)
     Set gApp = CreateObject("AcroExch.App")

    Set gPDDoc = CreateObject("AcroExch.PDDoc")
     If gPDDoc.Open(strPDFPath) Then
         Set jso = gPDDoc.GetJSObject


         Set BMR = jso.bookmarkRoot
         
         ' if the cover/toc is included then we add this in and
         ' the integer makes sure the bookmarks are assigned right
         ' further down if the cover/toc are included.
         If blnIncludeCoverTOC Then
             BMR.createchild "Report Cover", "this.pageNum= 0", 0
             BMR.createchild "Table of Contents", "this.pageNum= 1", 1
             intWithCover = intWithCover + 1
         End If
         With rst
             Do Until .EOF
                 varBMName = "this.pageNum= " & CStr(!Pg + intWithCover)
                 x = !Pg + intWithCover
                 varBM = !ReportCaption
                 BMR.createchild varBM, varBMName, x
                 .MoveNext
             Loop
             gPDDoc.Save PDSaveCopy, strPDFPath

            gPDDoc.Close
         End With
     End If

    Set gPDDoc = Nothing
     rst.Close
     Set rst = Nothing
     AddBookmarks = True

ExitHere:
      Exit Function

Errors:
             AddBookmarks = False
             MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure AddBookmarks of Module basAcrobat2", , CurrentDb.Properties("AppTitle")
             Resume ExitHere
             Resume

End Function
0
 

Accepted Solution

by:
rogerdjr earned 0 total points
ID: 39685715
Please re-open and I'll make the change

I did not understand the grading system - my apologies to the expert that was trying to help.
0
 

Author Closing Comment

by:rogerdjr
ID: 39695016
Expert - provided a response that led me to the web to get a solution
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

809 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