I want to launch a word application to print a document which does not have .DOC extension, although it is a word document. I have tried using ShellExecute method unsuccessfully.
There are some other shell commands that allow you to specify which application to use. You may want to look into one of those. I believe the shellexecute API uses the windows file extention associations to determine which app to open the file with. Thanks and Good Luck!
Try passing the name of the file to the word executable as the command line. I have Office 2000, and the path for the executable for Word is c:\Program Files\Microsoft Office\Office10\winword.exe. So, to open a file in Word using the Shell command from VB, I used the following line:
Pay attention to the quotes. The path for the executable and the path for the document both need to be in quotes, and since I'm passing the command line as a string, I have to have the whole thing in quotes, and use quote-quote everywhere a quotation mark should be in the command line.
Check out the ShellExecuteEx API with the action verb being "print". Just one caution: you will need to associate the extension of the file to the program you want to use.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.