Connecting Tech Pros Worldwide Help | Site Map

Email Message within MS Access

  #1  
Old November 13th, 2006, 07:45 PM
Drum2001
Guest
 
Posts: 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?

  #2  
Old November 14th, 2006, 01:35 PM
Ron2006
Guest
 
Posts: n/a

re: Email Message within MS Access


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

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access Reports and VB.NET Program JoeW answers 16 August 22nd, 2006 11:05 PM
Advice needed: Should we upgrade MS Access 2000? And if so to what? ship answers 47 November 13th, 2005 11:39 AM
Emailing from within MS Access Greg answers 4 November 12th, 2005 09:26 PM