excel - Move Attachment Script -
i have vba script have used move attachments emails folder consumption ssis package. however, want alter script renames attachment saves folder.
here current script.
public sub saveattachmenttodisk(itm outlook.mailitem) dim objatt outlook.attachment dim savefolder string savefolder = "\\vswi-sql\databases\datawarehouse\universal_dw\cs\cs_imports" each objatt in itm.attachments objatt.saveasfile savefolder & "\" & objatt.displayname set objatt = nothing next end sub
i not familiar vba enough comfortably make correction, have feeling it's alteration last few lines.
the attachment received named "workbook_4x5ofxqg7.xls", broadcasted report our netweaver system. want save "hris_cs_complaints.xls".
you have change line
objatt.saveasfile savefolder & "\" & objatt.displayname
in particular case:
objatt.saveasfile savefolder & "\" & "hris_cs_complaints.xls"
please note save attachments under file name, think should @ least add variable suffix file name current timestamp, attachment index etc.
Comments
Post a Comment