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

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -