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!

Printing to pdf files

Status
Not open for further replies.

steveostash

Programmer
Nov 6, 2002
6
CA
Alright this one might seem a little crazzy, but none the less should get some of you thinking. I am wanting to add in a electronic way for clients of send invoices from my app. I have the ability to print to pdf's using distiller but what i wanted to do was a seamless way(point and click) to print these pdf's to a file automaticaly put them in an email and send them off, next time the user gets a connection to there isp. since some are still on dial-up it can't be an instant thing. as well if there is multiple orders for one client to "auto creat" a zip file of the pdf's and then mail. I know this is alot to digest but i have had a lot of requests for this and am a little stumped.

Thanks,
Steve
 
We have done something similar in our app which creates the PDF (we assign the file name), interacts with Outlook via OLE (creates message, assigns topic / message text if any, and addresses message), attaches the file, and then sends it out.

Since this is an internal app and Outlook is company standard, we don't have to worry about differences in mail clients.
 
This sounds exactly what i want to do. I am having some real problems finding info on doing this. Any pointers as far as how to go about this.
 
Here is some code to play with.

lole_outlook = Create OLEObject
//Connect to Outlook session using 'Outlook.Application'
li_rc = lole_outlook.ConnectToNewObject"outlook.application")
//Check for the return code
If li_rc <> 0 Then
// ERROR CONDITION
Messagebox(&quot;Outlook Error&quot;,string(li_rc))
Destroy lole_outlook
Return li_rc
End If
//Creates a new mail Item
lole_item = lole_outlook.CreateItem(0)
//Set the subject line of message
lole_item.Subject = &quot;Notice&quot;
//Body of mail message
lole_item.Body = &quot;Please review the attached file and advise: &quot;+Char(13)
//Recipient(s) Use a semicolon to separate multiple recipients
lole_item.To = dw_vendorfax.getitemstring(1,'contactemail')
lole_attach = lole_item.Attachments
lole_attach.add(is_doc)
lole_item.Display //displays the message
// lole_item.Send //sends the message
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top