How to ShellExecute a PDF to a specific page
-
I have a PDF. If I use this CString Path = GetPath("manual.pdf"); ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL); The PDF executes. But if I then use Path += "#page=17"; ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL); or anything similar, I cant get the PDF to execute. I want the PDF to execute and jump to a specific page. I found solutions, I think, where I can execute the adobe.exe file and the path, but I dont know where adobe.exe is located on these computers. Is there any way to execute a PDF without knowing where the adobe executable is at? Please, any response any one can give me will be greatly appreciated.
-
I have a PDF. If I use this CString Path = GetPath("manual.pdf"); ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL); The PDF executes. But if I then use Path += "#page=17"; ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL); or anything similar, I cant get the PDF to execute. I want the PDF to execute and jump to a specific page. I found solutions, I think, where I can execute the adobe.exe file and the path, but I dont know where adobe.exe is located on these computers. Is there any way to execute a PDF without knowing where the adobe executable is at? Please, any response any one can give me will be greatly appreciated.
I suspect you can't open it to a specific page without knowing where Acrobat resides, but no matter - you can find that out from the registry apparently. If you have a look at the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AcroRd32.exe\
you can get the full-path of the exe. From there, it's seems to be just a matter of passing that file to shell execute along with using a parameter that includes (1) the full path to the pdf doc and (2) the desired page num. Anyhoo - here's my source: http://www.devhut.net/2013/12/04/vba-open-a-pdf-to-a-specific-page/[^] -
I have a PDF. If I use this CString Path = GetPath("manual.pdf"); ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL); The PDF executes. But if I then use Path += "#page=17"; ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL); or anything similar, I cant get the PDF to execute. I want the PDF to execute and jump to a specific page. I found solutions, I think, where I can execute the adobe.exe file and the path, but I dont know where adobe.exe is located on these computers. Is there any way to execute a PDF without knowing where the adobe executable is at? Please, any response any one can give me will be greatly appreciated.
-
I have a PDF. If I use this CString Path = GetPath("manual.pdf"); ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL); The PDF executes. But if I then use Path += "#page=17"; ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL); or anything similar, I cant get the PDF to execute. I want the PDF to execute and jump to a specific page. I found solutions, I think, where I can execute the adobe.exe file and the path, but I dont know where adobe.exe is located on these computers. Is there any way to execute a PDF without knowing where the adobe executable is at? Please, any response any one can give me will be greatly appreciated.
Another thing to think about is whether the computers you are targetting have Adobe reader installed at all. Personally, I use SumatraPDF for viewing PDFs, but there is a Microsoft reader app (its name escapes me right now), Foxit Reader, and probably others. Each of them could have different ways to specify the page to show first.
-
I have a PDF. If I use this CString Path = GetPath("manual.pdf"); ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL); The PDF executes. But if I then use Path += "#page=17"; ShellExecute(0, "open", Path, NULL, NULL, SW_SHOWNORMAL); or anything similar, I cant get the PDF to execute. I want the PDF to execute and jump to a specific page. I found solutions, I think, where I can execute the adobe.exe file and the path, but I dont know where adobe.exe is located on these computers. Is there any way to execute a PDF without knowing where the adobe executable is at? Please, any response any one can give me will be greatly appreciated.
What is the net value of
Path
?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles