By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,480 Members | 3,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,480 IT Pros & Developers. It's quick & easy.

Email Message within MS Access

P: n/a
I have a database that strips an attachment from an MS Outlook e-mail
and saves it to a designated folder. Is there any way to save the
actual message itself?

Nov 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Yes there is. The trick is figuring out which email to save. The
following routine is looking through the sent folder for a certain
email and then saving it. You will have to take it from there and
modify to fit your requirements - different folder and how to identify
which one.

========================================

Set olApp = CreateObject("Outlook.Application")
Set oLMapi = olApp.GetNamespace("MAPI")
Set olF = oLMapi.GetDefaultFolder(olFolderSentMail)
Set olIt = olF.Items
' Set olItems = oLMapi.GetDefaultFolder(olFolderSentMail).Items
For Each m In olIt

' ' If m.Subject = hldSubject Then ' was used
but not now.

If InStr(1, m.Body, hldTimeStamp) 0 Then
wrkSubject = m.Subject
wrkSubject = Replace(wrkSubject, ":", " ")
wrkSubject = Replace(wrkSubject, "/", " ")
saveasname = newsubdir & wrkSubject & " - TmStmp-" &
curdate & ".msg"
m.SaveAs (saveasname)
ordersaved = 1
GoTo getoutofemail
End If
Next m

getoutofemail:

Ron

Nov 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.