Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2020, 09:41 PM
leeqiang leeqiang is offline How to use vba to open a pdf file to a page you want? Windows 10 How to use vba to open a pdf file to a page you want? Office 2019
Advanced Beginner
How to use vba to open a pdf file to a page you want?
 
Join Date: Aug 2020
Posts: 49
leeqiang is on a distinguished road
Default

Quote:
Originally Posted by Logit View Post



Sub openPDFFileXPage()
Dim oShell As Object
Dim nPage As Integer


Set oShell = CreateObject("WScript.shell")
nPage = Application.InputBox("page£º")
With oShell
.Run """C:\Users\N. Gregory Mankiw - Principles Of Economics (2021, Cengage Learning) - libgen.lc.pdf""", 5, False
.Run """C:\Users\N. Gregory Mankiw - Principles Of Economics (2021, Cengage Learning) - libgen.lc.pdf""", 5, True
.SendKeys "^+N"
.SendKeys VBA.CStr(nPage)
.SendKeys "{ENTER}"
End With
Set oShell = Nothing
End Sub



how to modify this code let the code automating add the file?
C:\Users\N. Gregory Mankiw - Principles Of Economics (2021, Cengage Learning) - libgen.lc.pdf
like the file link address added in a dialogue box to select on pdf file the code add the link after run""?

thx
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Every Folder I open goes into File Explorer but when I click on a file it won't open bird dog Word 3 10-08-2019 10:03 AM
How to use vba to open a pdf file to a page you want? HELP! Computer crashed, no recovery file, old versions, etc and file was open for over 24 hours! matthew.coppedge Word 2 04-07-2016 09:01 PM
How to use vba to open a pdf file to a page you want? Formula to open external file with specific program (like open with) pemartins Excel 16 02-24-2014 11:39 PM
How to use vba to open a pdf file to a page you want? excel cannot open the file .xlsx because the file format or file extension is not val teddysika Excel 1 11-22-2012 06:06 AM
Possible to open each page of file in a different window? Fran71 Word 2 04-27-2012 07:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:43 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft