T
The Old Bloke
In Outlook 2003 I had a macro to extract embedded images.
This is it
Sub SaveAttachment()
Dim objCurrentItem As Outlook.MailItem
Dim colAttachments As Outlook.Attachments
Dim objAttachment As Outlook.Attachment
Set objCurrentItem = Application.ActiveInspector.CurrentItem
Set colAttachments = objCurrentItem.Attachments
Set strFolderpath = CreateObject("WScript.Shell")
For Each objAttachment In colAttachments
objAttachment.SaveAsFile ("D:\Doug\anni" & "\"
&objAttachment.FileName)
Next
Set objAttachment = Nothing
Set colAttachments = Nothing
objCurrentItem.Close (olDiscard)
Set objCurrentItem = Nothing
End Sub
I don't know VBA. However when I put this macro in Outlook 2007 I get
this error message
"Object variable or With block variable not set"
Can someone help me?
Regards
Doug
This is it
Sub SaveAttachment()
Dim objCurrentItem As Outlook.MailItem
Dim colAttachments As Outlook.Attachments
Dim objAttachment As Outlook.Attachment
Set objCurrentItem = Application.ActiveInspector.CurrentItem
Set colAttachments = objCurrentItem.Attachments
Set strFolderpath = CreateObject("WScript.Shell")
For Each objAttachment In colAttachments
objAttachment.SaveAsFile ("D:\Doug\anni" & "\"
&objAttachment.FileName)
Next
Set objAttachment = Nothing
Set colAttachments = Nothing
objCurrentItem.Close (olDiscard)
Set objCurrentItem = Nothing
End Sub
I don't know VBA. However when I put this macro in Outlook 2007 I get
this error message
"Object variable or With block variable not set"
Can someone help me?
Regards
Doug