Code to create fldr for saved O2K message graphics if it isn't already there?

S

StargateFan

I've not had any luck with this; I've been told about something called
FileSystemObject, but that term is Greek to me. I of course looked in
the help file and tried to understand the process but no luck.
Nothing has worked. The code below comes from a website that was
recommended in one of these Outlook ngs and it allows us to save
embedded graphics in messages. _I_ didn't create this. So if it
looks sophisticated, it's because the person coding it knows what
they're doing, it sure looks like. It does have one _serious_ flaw,
if the folder isn't present, the graphics aren't saved and we aren't
warned of this fact either.

Any help with code would be greatly appreciated. Just a newbie here,
not even close to being a vb expert or anything though I've been able
to do a lot more on my own lately. Tx.

****************************************************************
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
("C:\WINDOWS\Desktop\OutlookEmbeddedGraphics\" &
objAttachment.FileName)
Next

Set objAttachment = Nothing
Set colAttachments = Nothing
Set objCurrentItem = Nothing

End Sub
****************************************************************
 

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