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

Print Manager Question

Status
Not open for further replies.

jmcd0719

Programmer
Jun 13, 2001
37
US
I need to interact with the print manager (Win 95/98) and change trays programically so that another application can print to the proper tray and or change the default printer.

This is not for an foxpro application but another application I run under foxpro.

Does anyone have a quickie solution?

Thanks
 
Here's a way to bring up the system's print dialog box. I haven't thoroughly tested it but so far it works if you are using a form. Add an MSComm control to your form named something like oPrintComm. In your code you can bring it up by issuing:

ThisForm.oPrintComm.ShowPrinter

You can then change your settings and continue with the processing.
This control may or may not be under 'ActiveX Controls' on the 'Form Controls' toolbar. If not, go to the 'Tools->Options' menu selection, select the 'Controls' tab, scroll down to the 'MS Comm Control' item and click the checkbox. Click on 'Set As Default' and the control will be added to the toolbar.

Dave S.
 
Here's an afterthought. %-). To create the object programmatically without a form, you can use something like:

oPrintComm = CreateObject("MSComDlg.CommonDialog.1")
oPrintComm .ShowPrinter()
RELEASE oPrintComm

Dave S.
 
Thanks for the reply.

sys(1037) also replicates your code above.

This changes the printer interactively but I need to change the default printer tray/printer programmically.

For example I am using an external Report Writer and I need to call the program and change the printer tray to automatically collate. I have created a copy of the printer setup in print manager and defaulted one to tray 1 and the other to tray 2. I did find a shareware program (since the posting) that will change the windows default printer from the command line. My code is as such: (remember the report writer only uses the default printer and tray set in windows.)

!setdefpr "Tray 1 Printer"
!start /w rrwrun FOXRPT 1
!setdefpr "Tray 2 Printer"
!start /w rrwrun foxrpt 2



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top