View Single Post
  #1  
Old January 3rd 10, 02:35 AM posted to microsoft.public.outlook.program_vba
The Old Bloke[_3_]
external usenet poster
 
Posts: 2
Default Saving Embedded Images in Outlook 2007

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
Ads