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

save image from email attachment and link to record

Status
Not open for further replies.

humvie

Technical User
Aug 14, 2002
61
CA
I've been asked to look into the possibility of saving an attachment from an email and then copy it to it's appropriate record.

This is the scenario. The email is sent from the same address and always has the same title content and contains one or more document images. Every email sent from this address always has a relative number identifying it from others. That number is also somewhere in the database so making the link should not be difficult. Ideally, I need to programically take the image(s) everytime the email is received (without manual intervention as there are thousands) and copy it into the database.

I have no idea where to start as I have never ventured outside the walls of ACCESS. Any help and direction would be appreciated.
regards,

humvie
 
You have to get two application working together; Access and, I'm assuming Outlook. I won't do it for you because it would be an extensive application. Outlook as an event called NewMail which is fired whenever new mail is received. You could then inspect the MailItem object to determine whether the subject matches some predefined subject that flags this type of a message. If it does then Save Attachment to some common directory and update a text logfile with the status. An Access module could be operating on a timer event that would check whether the log file were open and inspect any newly appended status lines. The line would include the pathname and filename of the deattached file. It would immediately release the file and copy the object into the appropriate record using ADODB recordsets. PROBABLY. Now I'm sure there could be dozens of other ways to do this but I'll only give this one possible. I've actually built an application in Outlook that does all of the required activities except log the status to a logfile. And actually there a probably other ways of logging the message status. Maybe just a remote call to an Access function from within Outlook.





-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top