Outlook macro for specific email

Joined
Jul 20, 2015
Messages
1
Reaction score
0
Hi, I am new to macros. Can someone please help me edit this code so that it only checks a specific email address in Outlook 2010? I have two emails set up right now and only want the macro to run on one of them...then move to a specific folder after it runs. Thanks.

Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim dateFormat
dateFormat = Format(Now, "mm-dd-yy H-mm ")
saveFolder = "S:PRINT"
For Each objAtt In itm.Attachments
If InStr(objAtt.DisplayName, ".pdf") Then
objAtt.SaveAsFile saveFolder & "\" & dateFormat & objAtt.DisplayName
End If
Set objAtt = Nothing
Next
End Sub
 
Back
Top