A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Print to PDF and Attach to E-mail with one command button



 
 
Thread Tools Display Modes
  #1  
Old September 23rd, 2005, 06:28 PM
Jonathan via AccessMonster.com
external usenet poster
 
Posts: n/a
Default 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  
Old September 23rd, 2005, 06:36 PM
ljb
external usenet poster
 
Posts: n/a
Default


"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  
Old September 24th, 2005, 01:13 PM
Arvin Meyer [MVP]
external usenet poster
 
Posts: n/a
Default

"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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.