Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 25 NOV 2003 05:58:20AM Pete Smith wrote:

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=0
lpOperation=print':\00\
lpFileName =docPath:'\':docFileName:\00\
lpParams   =\00\
lpDir      =\00\
iShow      =2
retVal=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.


At 25 NOV 2003 08:32AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

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.

The Sprezzatura Group

World leaders in all things RevSoft


At 27 NOV 2003 04:32AM Colin Rule wrote:

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


At 27 NOV 2003 07:03PM Barry Stevens wrote:

Got any /m commands for Acrobat Reader?


At 27 NOV 2003 10:27PM Steve Smith wrote:

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


At 28 NOV 2003 03:28AM Barry Stevens wrote:

  • third_party_content/community/commentary/forums_nonworks/f12ab728f809912085256de9003c45c9.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1