PDA

View Full Version : how to view a pdf to a specific page



laboymc
06-10-2014, 07:26 AM
It doesn't work where the If statment is "If IsNull(Me.Jumpto) Then"

Sub GoToPage()
Dim AcroApp As CAcroApp, AVDoc As CAcroAVDoc
Dim PDDoc As CAcroPDDoc, MyFilePath As String
Dim mystring As String, MyPage As Long
MyFilePath = "C:\Desktop\Test.pdf"
Set AcroApp = CreateObject("AcroExhc.App")
Set AVDoc = CreateObject("AcroExch.AVDoc")
AVDoc.Open MyFilePath, ""
Set PDDoc = AVDoc.GetPDDoc
If IsNull(Me.Jumpto) Then
MsgBox ("enter a page number")
Else:
MyPage = Me.Jumto - 1
AVDoc.GetAVPageView.GoTo.MyPage
AcroApp.Show
End Sub