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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Form as PDF from Command Button

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
In Access 2003 you can have a form open and Click:
File
Send To
Mail Recipient as Adobe Pdf.

That works good. I have been asked to see if we cannot
accomplish the same thing from a Command Button on the Form.
Anyone got any ideas? I have researched and searched and
have not been able to come up with anything.
 
That feature is based on functionality provided by your Adobe PDF writing software.
There are plenty of FAQs on the Tek tips Access fora explaining how to automate the creation of a PDF from an Access form or report, and it is simply a matter of customising this to save in a specific location then attach this file to an email.

John
 
Try using "use VBA to email pdf" to search with. Also FAQ703-2533 and thread705-816439 should get you started.

Good luck.
 
I have looked at all the faq's I can find and have searched on VBA to email pdf and they are of no help that I can see.
I have tried the code below and when I fire the code I get
a popup box to select the type but pdf is not one of them. I
do not want to send a report and want to send a copy of the
form. When I click File and the Send To I have the option to
Send as a pdf. I just do not know how to get this to a
Command Button. Any others out there with an example or
suggestion. I have searched Google and three different
forums. HELP!!

Code:
DoCmd.SendObject acSendForm, "BucketEcnOutsideDateFrm", acFormatPDF, "BucketForm"

 
Help!! I beleive we did, the general concept and 2 places to help with understanding the process. If you want to send an e-mail with a pdf file attached using the VBA of Command Button you MUST create the pdf file. "That feature is based on functionality provided by your Adobe PDF writing software."

What type of PDF writing software do you have, equally important what version? Adobe makes changes with each version.
 
I have Adobe Acrobat 8 and I have PDF Writer.

I want to hit the button and have the PDF file created. Then I want to attach the pdf file to the email. All using
the same Command Button.

I can do that currently by doing the following:

File
Send To
Mail Recipient as Adobe PDF

I want to be able to do the same thing as above by using
code on a Command Button. That is my goal. Everything you
have sent me to read or utilize does not show how to
accomplish this. Please advise.
 
The following is from the FAQ I listed above. I would suggest you print it out. Time to get your hands dirty and see what works and what doesn't.

It is not a difficult task to save a file in PDF Format. This can be useful as it will keep all you formating, lines, boxes, and images. With just a small set of code and a simple call procedure, you can have any and all of your reports saved into the PDF format.

This code will:
- Determine you current default printer and save it as a variable
- Set your default printer to the Adobe Writer
- Save the file as PDF using the provided arguements
- Set your default printer back to what it was prior to this process

Important Note: You must have Adobe Writer (which you have to purchase) in order for this to work. Having Adobe Reader (Acrobat Reader), which can be downloaded from the Internet for free, will not work for you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top