How to use the PDBookMark object to navigate to the bookmarked page?I h
I have an Excel spreadsheet in which one column contains the bookmarks from several PDFs. For each bookmark, an adjoining cell contains a button with VBA code to open the corresponding PDA to the page specified by the book mark. There are nearly 600 rows in the spreadsheet and more than two dozen associated PDFs. While the underlying code is simple, it's very tedious to set up and maintain. I have been trying too make the code more general by using the PDDoc PDBookMark.Perform method. Unfortunately I'm only able to open the desired PDF to page 1. I don't understand the IAC documentation on how to set up and code this method. Seems like I'm missing something. Any assistance in helping to make this work will be greatly appreciated. I'm using Acrobat Pro DC and have the Acrobat 10.0 TLB reference set . Here's the code so far:
Sub Inpatient_170()
Dim AVDoc As Acrobat.CAcroAVDoc
Dim AVPageView As Acrobat.CAcroAVPageView
Dim PDDoc As CAcroPDDoc
Dim PDBookmark As AcroPDBookmark
Dim strfile As String
Dim myBookMark As String
Dim rw As Integer
'Get PDF path and file name (this will eventually work like the bookmark selection below)
strfile = "C:\Completed\Final - Edited - Inpatient Historical Records (2).pdf"
'Grab the bookmark from the spreadsheet
rw = ActiveCell.Row
myBookMark = Worksheets("Sheet1").Range("C" & rw)
Set AcroApp = CreateObject("AcroExch.App")
Set AVDoc = CreateObject("AcroExch.AVDoc")
Set PDDoc = CreateObject("AcroExch.PDDoc")
Set PDBookmark = CreateObject("AcroExch.PDBookmark")
AVDoc.Open strfile, vbNull
Set AVPageView = AVDoc.GetAVPageView
AcroApp.Show
Set PDDoc = AVDoc.GetPDDoc
PDBookmark.GetByTitle PDDoc, myBookMark
PDBookmark.Perform PDDoc
Set avPageView = Nothing
Set avDoc = Nothing
End Sub
