I am trying to get ShellExecuteA to print a word document without having Word show up on the screen. I want Word to appear minimised, hence the code:
declare function ShellExecuteA
hWnd=0lpOperation=print':\00\lpFileName =docPath:'\':docFileName:\00\lpParams =\00\lpDir =\00\iShow =2retVal=ShellExecuteA(hWnd,lpOperation,lpFileName,lpParams,lpDir,iShow)However, Word always displays irrespective of what I set iShow to.
I have prototyped DLL_SHELL32 as:
SHELL32
handle STDCALL ShellExecuteA( handle, lpchar, lpchar, lpchar, lpchar, int)
Any ideas?
Thanks.
Pete,
It's possible that MS have programmed Word to ignore the iShowCmd argument. This is usually passed to a program via it's WinMain entry point and it's upto the application to act accordingly when it gets it.
World leaders in all things RevSoft
You could also just use Utility RUNWIN, and execute the document.
If you pass the the following as options, it will start Word minimised, print and close.
/mAppminimize /mFilePrintDefault /mFileExit
Basically, every menu option in Word has an associated macro name, which can be called with /m
Colin
Got any /m commands for Acrobat Reader?
Barry, try shell the command -
c:\Acrobat 6.0\Reader\AcroRd32.exe /t "c:\path\myfile.pdf"
"HP LaserJet 6MP" "winspool" "LPT1:"
Include the quotes.
Steve
Thx Steve