View Single Post
  #2  
Old March 9th 07, 02:12 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,222
Default How to have Outlook create folder if folder is not present?

FileSystemObject. FolderExists(FolderSpec As String) As Boolean

If it doesn't exist then use FileSystemObject.CreateFolder(Path As String)
As Folder


--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"StargateFan" wrote in message
...
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
 

Bleach 151 . Bleach 152 - Debt Management - Car Insurance - Mortgages - Online Dating