antonioking
asked on
vb move msg attachments and delete original emails
Please can somebody help me with a script that can process emails in a folder in Outlook 2010 (x64)
Any email found to have a .msg attachment, move the attachment to the folder and delete the original email.
Thanks
antonio
Any email found to have a .msg attachment, move the attachment to the folder and delete the original email.
Thanks
antonio
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think you need the Redemption addin object to read the .msg and save as an email....
http://www.dimastr.com/redemption/objects.htm
http://www.dimastr.com/redemption/objects.htm#SafeMailItem
Attachment : EmbeddedMsg property
Allows to access embedded message attachments. Returns MessageItem object. For regular (file) attachments this property is NULL
http://www.dimastr.com/redemption/objects.htm
http://www.dimastr.com/redemption/objects.htm#SafeMailItem
Attachment : EmbeddedMsg property
Allows to access embedded message attachments. Returns MessageItem object. For regular (file) attachments this property is NULL
ASKER
Thanks for this
I saved the attachments to a windows folder then dragged and dropped.
Had to slightly modify the code as some email subjects contained characters windows won't let you name files with.
So here is my replaced code between lines 16-20
i = i + 1
If ObjAttach.Type = olEmbeddeditem Then
ObjAttach.SaveAsFile strSaveFolder & "\Email-" & i & ".msg"
Set objAtt = Nothing
bMsgTrue = True
End If
I saved the attachments to a windows folder then dragged and dropped.
Had to slightly modify the code as some email subjects contained characters windows won't let you name files with.
So here is my replaced code between lines 16-20
i = i + 1
If ObjAttach.Type = olEmbeddeditem Then
ObjAttach.SaveAsFile strSaveFolder & "\Email-" & i & ".msg"
Set objAtt = Nothing
bMsgTrue = True
End If
ASKER
I actually wanted to save/copy/move the .msg attachments form the email to the same folder within Outlook. Not to a windows directory.
Regards