View Single Post
  #1  
Old March 9th 07, 11:50 AM posted to microsoft.public.outlook.program_vba
StargateFan
external usenet poster
 
Posts: 48
Default How to have Outlook create folder if folder is not present?

This macro is missing code to create the folder, if the folder
"Outlook embedded graphics" isn't present.

What does this need to check for this folder, pls, and to create it if
it isn't there?

************************************************** **********************************
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:\Documents and
Settings\Compaq_Administrator\Desktop\Outlook embedded graphics\" &
objAttachment.FileName)
Next

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

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

Thanks! D

Ads