If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Print to PDF and Attach to E-mail with one command button
I am trying to create a PDF of the current record of a form and have it
attached to an e-mail with the click of one button. Currently, the user has to manually attach the PDF to an e-mail after they save it. Any help would be greatly appreciated. -- Jonathan Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
"Jonathan via AccessMonster.com" wrote in message ... I am trying to create a PDF of the current record of a form and have it attached to an e-mail with the click of one button. Currently, the user has to manually attach the PDF to an e-mail after they save it. Any help would be greatly appreciated. -- Jonathan Message posted via http://www.accessmonster.com Write the PDF file to some temporary location and call the function below assuming you want to use Outlook. Delete the temp file after. Public Sub MailIt(strContactName As String, strFile As String) Dim objOutLook As Outlook.Application Dim objMail As Outlook.MailItem Dim objContact As Outlook.Recipient Set objOutLook = New Outlook.Application Set objMail = objOutLook.CreateItem(olMailItem) With objMail .To = strContactName .Subject = " some subject line" .Attachments.Add (strFile) .Display End With Set objMail = Nothing Set objOutLook = Nothing End Sub |
#3
|
|||
|
|||
"Jonathan via AccessMonster.com" wrote in message
... I am trying to create a PDF of the current record of a form and have it attached to an e-mail with the click of one button. Currently, the user has to manually attach the PDF to an e-mail after they save it. I use Steve Arbaugh's Mail and PDF class, in conjunction with Win2PDF. The class works with most popular PDF creators, but I've found that Win2PDF is so much faster and more trouble-free than either the free ones, or especially Adobe Acrobat that I wouldn't dream of using anything else. This isn't a free solution, but it is a smooth one. My code creates a PO report, then makes a PDF and gathers several other PDFs and merges them into the one I created, creating a new PDF, then it finds the email address and and sends the PO as an attachment by email. Here are the pertinant programs: Mail and PDF Class: http://ourworld.compuserve.com/homepages/attac-cg/ Win2PDF: http://www.win2pdf.com/ -- Arvin Meyer, MCP, MVP Microsoft Access Free Access downloads: http://www.datastrat.com http://www.mvps.org/access |
Thread Tools | |
Display Modes | |
|
|