Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use the SHELL command for a PDF file. What is the executable

Status
Not open for further replies.

Pack10

Programmer
Feb 3, 2010
495
US
I have a routine that loads email attachments. Using a shell command I can have Word and Excel run their attachments, however if an attachment is a PDF, how does the Shell statement need to be coded to load the PDF file.

Thx
 
Not 100% sure with VBA but I have called it in javascript like this before:
Code:
function OpenPDF(str) {

    var oShell = new ActiveXObject("Shell.Application");
      
    var commandtoRun = str;

    oShell.ShellExecute(commandtoRun, "", "", "open", 1);

        }

Where str / commandtoRun are the full path of the PDF

This would indicate that you can use ShellExecute to simply open a PDF natively with

ReferenceToshell.ShellExecute(PathofPDF.pdf,"","","open",1)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top