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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP print command for MS Works

Status
Not open for further replies.

trick66

Vendor
Sep 25, 2001
23
0
0
US
Please help, I am trying to modify VFP app to print attached WORKS (.XLR) files. The app can handle EXCEL (.XLS) files, but does not have the command for WORKS files. Here is the command that controls the printing of EXCEL file:

FUNCTION PRINTEXCELDOC
LPARAMETER FILENAME
OEXCEL = CREATEOBJ("Excel.Application")
WITH OEXCEL
.VISIBLE = 0
.WORKBOOKS.OPEN( FILENAME )
.ACTIVEWORKBOOK.PRINTOUT
.QUIT
ENDWITH
RELEASE OEXCEL
RETURN

Could someone take a look at the above command and tell me what I need to change so that it will work for WORKS files? Thanks in advance.

Rick

 
Rick,

I'm not sure, but I believe Works is not a COM server, so you can't use the same technique as Excel (someone will correct me if I'm wrong about that).

You might be able to do it using ShellExecute(). If you right-click on a XLR file in Windows Explorer and see a Print command, then ShellExecute() should work. Just pass "print" (in quotes) as the second parameter.

If you need to know the syntax, just ask. Or refer to:

Mike


Mike Lewis
Edinburgh, Scotland
 
Mike Lewis

I'm not sure, but I believe Works is not a COM server, so you can't use the same technique as Excel (someone will correct me if I'm wrong about that).

That has also been my findinds, Works is not a COM.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top