Access XP/2000 - Outlook Question

J

John

I have an Access XP/2000 application that processes my messages and loggs
them for the office. However, I am having trouble accessing my attachments.
We have an e-mail that is forwarded by my boss every day. Attached to this
e-mail is another e-mail that contains a text/Word Document.

I have successfully found the attachment, and can save it as a ".MSG" file.
However, I cannot access it to get the attached text/Word document.

Any Help would be appreciated. Sample code below.

John.

Sample Code:

---- begin----
Dim myolApp, myfolder, myNewfolder
Dim myItem As Outlook.MailItem
Dim oReply As MailItem
Dim oRecips As Outlook.Recipients
Dim oRecip As Outlook.Recipient
Dim myObject As Variant
Dim thisAttachment As Variant
Dim thisMailItem As Outlook.MailItem
Dim myNewItem As Outlook.MailItem
Dim oThisItem As Outlook.ItemProperty

Dim SenderEmail As String, SenderName As String
Dim UnitPrice As Variant, postIt As Integer, emailContents As String
Dim UserName As Variant, UserCompany As Variant, UserEmail As Variant,
UserAmountPaid As Variant
Dim bAttachment As Boolean
Dim oFolder As Outlook.MAPIFolder
Dim oAttach As Outlook.Attachment
....
If myItem.Attachments.Count > 0 Then
For Each oAttach In myItem.Attachments
Debug.Print oAttach.Application
If (oAttach.Class) = "olAttachment" Then
Debug.Print oAttach.fileName
Debug.Print myfolder.FolderPath
oAttach.SaveAsFile myfolder.FolderPath & "\" &
oAttach.fileName
Set oThisItem = oAttach

End If
Set thisMailItem = oAttach

ImportOutlookMessage (thisMailItem)

Next oAttach
bAttachment = True
End If

---- end ----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top