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 07 DEC 2000 11:39:50AM b cameron wrote:

What is the best way to kick a word doc to the printer

from a OI form via a button?

For instance the word document may be

e:\share\docs\form1.rtf

Would like the button to invoke this to print to the default printer

but be tranparent to the user.


At 07 DEC 2000 12:20PM b cameron wrote:

I just reread this and realized that I need to be more specific.

This is not really an OI question. I I can use the runwin utility.

What I don't know is the switches to get word to open, read, print and close.

TIA


At 07 DEC 2000 02:15PM matt sorrell wrote:

Well, it seems to me you have two choices. You can either automate Word via DDE, or you can base the documents of off a template that includes a macro to automatically print.

Perhaps a better option would be to write a small VB app, giving you the advantage of accessing the Word DOM. You could runwin this VB app, and as a command line arguement pass the name of the document to print. The VB app would then instantiate Word, open the document, print the document to the default printer, and then exit.

This should only take around 30 - 40 lines of code, at most.

If you would like to see some sample code that would do this, let me know and I'd be glad to help out.

msorrel@greyhound.com


At 07 DEC 2000 02:29PM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:

For more reliable results use ShellExecute as follows :-

Prototype the DLL definition as DLL_SHELL

SHELL

ushort pascal ShellExecute(ushort, lpchar, lpchar, lpchar, lpchar, short)

then call it as follows :-

h=Get_Property(@Window, 'HANDLE')

verb=print' : \00\

file=C:\windows\script.doc' : \00\

parameters=\00\

directory=\00\

show=0

Declare Function ShellExecute

Z=ShellExecute(h, verb, file, parameters, directory, show)

The Sprezzatura Group

World Leaders in all things RevSoft

View this thread on the forum...

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