-
Solved: Autosave file with SUBJECT as filename
First, thanks in advance. Either for the code or the links for help...
Using Outlook 2010 on Exchange. I'll have scans emailed with PDF attachments. Subjects will be unique to email. I'd like to include a script in the rule to save the file using the SUBJECT of the email. After reading many sites and fiddling with code (obvious noob here), it's simply not working. See below for where I am. Laughter allowed.
[vba]
Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim strFile As String
Dim strFolderpath As String
Dim strFileName As String
Dim objSubject As String
strFolderpath = "C:\Users\kmurphy\Documents\Dropbox\Public File"
objSubject = objMsg.subject
strFileName = objSubject & ".pdf"
strFile = strFolderpath & strFileName
For Each objAtt In itm.Attachments
objAtt.SaveAsFile strFile
Set objAtt = Nothing
Next
End Sub[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules