Embedded images

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 VB. 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
 
T

techstress

I'd like to ask which line the error occurs on.

Please do the following

Rercreate the error.

Click Debug

Post the text inside the highlighted line.
 

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