473,326 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

auto attaching a pdf from access

116 100+
Hi there
Hope someone out there can help.

I have create a report for adding customer complaints. When I click a button it opens up a report relating to that customer.

what I want to do is to click a button and it automatically send a copy of that report (as pdf) to the customer whose email address is already in the form. Is this posible. I know i can save as pdf and send from there but it really needs to be automated so it opens outlook, attaches the pdf and sends and then closes outlook.

Hopefully there will be some clever coding out there.
Thanks
jacc14
Aug 7 '07 #1
3 1173
Rabbit
12,516 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. Dim objOL As Outlook.Application
  2. Dim mi As Outlook.MailItem
  3. Dim rec As Outlook.Recipient
  4.  
  5. Set objOL = New Outlook.Application
  6. Set mi = CreateItem(olMailItem)
  7.  
  8. With mi
  9.     Set rec = .Recipients.Add("someone@someplace.com")
  10.     rec.Type = olTo
  11.     rec.Resolve
  12. End With
  13.  
  14. Set rec = Nothing
  15. Set mi = Nothing
  16. Set objOL = Nothing
  17.  
The rest you should be able to figure out yourself. You might have to add a reference to the microsoft outlook objects library.

Some Outlook environments don't let you do this because of security. Some will ask the user to allow the code to run.
Aug 20 '07 #2
jacc14
116 100+
thats brilliant. Thank you.
Aug 23 '07 #3
Rabbit
12,516 Expert Mod 8TB
Not a problem. Good luck.

With some experimenting you should be able to create a whole mail item.
Aug 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Arno R | last post by:
Hi all I still have clients with apps running on Access 2.0 It would be nice if I could use the Auto FE Utility for 1 of them Anybody tried the Auto FE Utility from Tony Toews with Access 2.0...
6
by: Armando | last post by:
Hey gurus - Access 2000 - I have a form with a series of box controls forming a map of clickable areas, and I want each one to have a label. No problem, just put 'em on, right? But I also want...
2
by: Mike N. | last post by:
Hello- I have a database that uses an auto number field type that goes out of sync periodically. My customer gets a "cannot add record, number already in use" error message. I dump the records...
4
by: Shahar | last post by:
Hi I need to get a field name 'ID'(that is an auto-number field) right after I add a new row to table, it's work like that: myCommand.ExecuteNonQuery(); myCommand.CommandText = "SELECT...
6
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I...
2
by: john | last post by:
Is it true that if I split my access database in backend and frontend and I implement custom auto increment for the ID fields, that my database is ready to be used in a multi-user environment? I...
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
2
by: ARC | last post by:
(sorry for the re-post, but I thought I would put the winmail.dat where it's visible in the subject...thanks!) Hello all, I have a question that I hope someone can help with. I have an Access...
3
by: Don Barton | last post by:
Does anyone know if Tony Toews Auto FE updater utility work with the new Access 2007 Runtime? I am new to using the runtime, but have clients starting to ask for it. (they don't want to have to...
4
by: jay123987 | last post by:
Morning / Afternoon / Goodday All, I was hoping someone can help me in understanding the best way to attach files to a access 2003 form. I have a database which is used to log phone calls and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.