Hey guys,
I'm trying to determine if it is possible to automatically import attachments from outlook emails into Access. Does anyone know if this is possible? I would think it would require VBA code.
Thanks
Hey guys,
I'm trying to determine if it is possible to automatically import attachments from outlook emails into Access. Does anyone know if this is possible? I would think it would require VBA code.
Thanks
I think you're right. I started with the Saving an Email Attachment code here:
http://www.thatlldoit.com/Pages/howtosarticles.aspx
So I found a a VBA code for exporting the attachments to a folder. Unfortunetly, my daily attachments are named the same so I have to set up a naming convention.
Here is my code. I tried to add msgitem.receivedtime to the file name to add email received time, but thats not working. Any suggestions?
' Save any attachments found
For Each Atmt In Item.Attachments
' This path must exist! Change folder name as necessary.
' FileName = "C:\Email Attachments\" & Atmt.FileName
'if want to add a filter:
'If Right(Atmt.FileName, 3) = "xls" Then
FileName = WheretosaveFolder & "\" & Atmt.FileName & msgItem.ReceivedTime
Atmt.SaveAsFile FileName
i = i + 1
Next Atmt
Next Item
Thanks
I'm getting a variable not defined with msgItem