Rename attachment in Outlook from Scanner

VulkaJohn

New Email
My scanner opens a new email with the scanned item ###.pdf as an attachment The attachment is only in the email not in a folder. I would like to rename the pdf to the same as subject line which results from running this macro, Any help will be appreciated.

Sub ScanedForm()
SetAsHTML
Dim MemNam As String
Dim Item As Outlook.MailItem
Dim oInspector As Inspector
Dim strSubject As String
Set oInspector = Application.ActiveInspector
If oInspector Is Nothing Then
Set Item = Application.ActiveExplorer.Selection.Item(1)
Else
Set Item = oInspector.CurrentItem
End If
MemNam = InputBox("MemberName")
strSubject = Item.Subject
strSubject = "Form Scanned at: " & Time & " For: " & MemNam
Item.Subject = strSubject
Item.To = "{redacted}"
Set Item = Nothing
Set oInspector = Nothing
End Sub
 
Last edited by a moderator:
Top