Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Seema Gokharu
  Where is Seema Gokharu?
 
 Texas - United States
 Seema Gokharu
 To: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 Tags
Subject: RE: CONVERT TO PDF & EMAIL IN VFP
Thread ID: 183498 Message ID: 189230 # Views: 5 # Ratings: 0
Version: Unknown Category: Reports and Printers
Date: Thursday, August 14, 2008 1:12:46 AM         
   


> > This is a 2 part question and probably one, that has been answered many times in this forum. But some of the related articles date back to 2002 and I am not sure if they currently apply or rather if they are the most optimum way of doing things.
> >
> > The VFP program in question was designed using an older version of VFP possibly Ver 6.0.
> >
> > Firstly, we are looking to redirect our printer output to an HTML or PDF file. We want to try and keep all the codes we are sending to the printer intact.
> >
> > We then want an option to email that file within VFP program to an address the user choses to type in. The recipient will then want to print the report and it should look like it was printed from the original program. I am assuming PDF will preserve the look.
> >
> > To be able to email files in VFP does one have to upgrade to VFP 9.0 or older VFP versions will work too. Do we have to have Outlook installed as our default mail client? Or is it possible to open up any default mail client that the user has setup for example Lotus notes.
> >
> > Can someone please direct me as to how I can approach these problems.
>
>
> YOUSFI BENAMEUR
> *I give you code created to convert any printable file with printer PDFCreator(download from web...google pdfcreator) or PDFWriter(download ...googlr...pdfwriter)
> *
>
> lcPDFPrinter="PDFCreator"      &&or Acrobat pdfWriter (in print panel)...downloadable
> lcOldPrinter=SET("PRINTER",2)      &&degrad old printer
> SET PRINTER tO NAME(lcPDFPrinter)  &&do default printer
> afile=getfile('frx|doc|htm|html|xls|rtf|ppt|pps|txt|prg|jpg|bmp|png|tif|gif')
> 
> if not empty(afile)
> 
> if lower(justext(afile))="frx"  &&vfp report 
> repo form (afile) TO print prompt
> 
> else
> 
> DECLARE INTEGER ShellExecute IN shell32.dll ; 
>   INTEGER hndWin, STRING cAction, STRING cFileName, ; 
>   STRING cParams, STRING cDir, INTEGER nShowWin
> 
> ShellExecute(0,"open",afile,"","",1)
> 
> inkey(5)
> oShell = CREATEOBJECT("Wscript.Shell")
> oShell.SendKeys("^{p}")   &&dialog printer CTRL+P
> endi
> 
> endi
> 
> 


Thanks Yousfi,Kishore,Mike and Surinder for your posts. Been out of the loop for a month. Will look into the solutions.
Seema

ENTIRE THREAD

CONVERT TO PDF & EMAIL IN VFP Posted by Seema Gokharu @ 7/14/2008 10:15:55 AM
RE: CONVERT TO PDF & EMAIL IN VFP Posted by surinder singh @ 7/14/2008 11:52:53 AM
RE: CONVERT TO PDF & EMAIL IN VFP Posted by Bruno Bosquet @ 11/24/2008 8:01:05 PM
RE: CONVERT TO PDF & EMAIL IN VFP Posted by Marat Chariev @ 11/25/2008 4:56:10 PM
RE: CONVERT TO PDF & EMAIL IN VFP Posted by Mike Gagnon @ 7/14/2008 12:02:05 PM
RE: CONVERT TO PDF & EMAIL IN VFP Posted by Kishore Kumar @ 7/14/2008 12:33:08 PM
RE: CONVERT TO PDF & EMAIL IN VFP Posted by Yousfi Benameur @ 7/14/2008 1:07:36 PM
RE: CONVERT TO PDF & EMAIL IN VFP Posted by Seema Gokharu @ 8/14/2008 1:12:46 AM
RE: CONVERT TO PDF & EMAIL IN VFP Posted by Boudewijn Lutgerink @ 11/26/2008 9:53:55 AM
RE: CONVERT TO PDF & EMAIL IN VFP Posted by Biju Thomas @ 11/26/2008 5:34:16 PM