|
-
Jul 10th, 2009, 11:35 PM
#1
Thread Starter
Junior Member
Opening pdf document-word VBA
Hi all,
I have a pdf document in a specified path. I want to open that pdf document using VBA code. Please advise.
Thanks,
Senthil. S
-
Jul 11th, 2009, 07:18 AM
#2
Re: Opening pdf document-word VBA
Try this...
vb Code:
Sub OpenPDF()
Dim AcroApp As CAcroApp, AVDoc As CAcroAVDoc
Dim PDDoc As CAcroPDDoc, MyFilePath As String
Dim mystring As String, MyPage As Long
'~~> Change this to an existing pdf file on your system
MyFilePath = "c:\Temp.pdf"
Set AcroApp = CreateObject("AcroExch.App")
Set AVDoc = CreateObject("AcroExch.AVDoc")
AVDoc.Open MyFilePath, ""
Set PDDoc = AVDoc.GetPDDoc
'~~> Navigate to a specific page
If IsNull(Me.Jumpto) Then
MsgBox ("enter a page to jump to")
Else:
MyPage = Me.Jumpto - 1
AVDoc.GetAVPageView.GoTo MyPage
AcroApp.Show
End Sub
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jul 13th, 2009, 12:55 AM
#3
Thread Starter
Junior Member
Re: Opening pdf document-word VBA
Dear Koolsid,
Thanks for your reply. To execute the code can you please mention what are the references i need to include.
Thanks,
Senthil. S
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|