S
StargateFan
Is there a way to add a couple of lines, one to check if the folder
exists and, if not, in a second line, to create it if that's the case?
Here is the code:
******************************************
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
******************************************
The folder in question is, of course, the "OutlookEmbeddedGraphics" on
the desktop.
I know that this is going to be easy for the experts in this ng, it's
just knowing what to do.
Thank you.
exists and, if not, in a second line, to create it if that's the case?
Here is the code:
******************************************
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
******************************************
The folder in question is, of course, the "OutlookEmbeddedGraphics" on
the desktop.
I know that this is going to be easy for the experts in this ng, it's
just knowing what to do.
Thank you.