Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yuri Rubinov
  Where is Yuri Rubinov?
 Philadelphia
 Pennsylvania - United States
 Yuri Rubinov
 To: Kurt Green
  Where is Kurt Green?
 Kingston
 Jamaica
 Kurt Green
 Tags
Subject: RE: print select pdf file from foxpro
Thread ID: 249239 Message ID: 249297 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Foxite: feedback
Date: Thursday, December 31, 2009 2:43:26 PM         
   


> >
> > For instance,
> >
> >
	DECLARE INTEGER ShellExecute ;
> > 			    IN SHELL32.DLL ;
> > 			    INTEGER nWinHandle,;
> > 			    STRING cOperation,;   
> > 			    STRING cFileName,;
> > 			    STRING cParameters,;
> > 			    STRING cDirectory,;
> > 			    INTEGER nShowWindow
> > 
> > ? ShellExecute(0,"print","c:\acrobat3\reader\acrobat.pdf","","",1)

> >
> > Best Wishes,
> >
> > Yuri Rubinov
>
> Hi Yuri
>
> Thanks for the Response really appreciated. What if i want to print to a specific printer?
>
> Thanks again in Advance

Then you need to set that printer as a default Windows printer. Like:

* Set default printer
oWSHNet = CREATEOBJECT('Wscript.Network')
oWSHNet.SetDefaultPrinter('WindowsPrinterName')

* or using SetDefaultPrinter WinAPI function
IF OS()>"5"
	DECLARE Integer SetDefaultPrinter IN WINSPOOL.DRV String
	IF SetDefaultPrinter('WindowsPrinterName') = 0
		messagebox("Cannot change default Windows Printer to ")
	ENDIF	
endif

*do not forget to set printer back to original default


Best Wishes,

Yuri Rubinov

ENTIRE THREAD

print select pdf file from foxpro Posted by Kurt Green @ 12/30/2009 10:09:39 PM
RE: print select pdf file from foxpro Posted by Yuri Rubinov @ 12/30/2009 10:15:21 PM
RE: print select pdf file from foxpro Posted by Kurt Green @ 12/31/2009 6:31:30 AM
RE: print select pdf file from foxpro Posted by Jun Tangunan @ 12/31/2009 7:16:37 AM
RE: print select pdf file from foxpro Posted by Yuri Rubinov @ 12/31/2009 2:43:26 PM