Outlook macro for specific email

Jul 20, 2015
Reaction score
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
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