vbScript to save attachment using part of the subject as the file name -
i'm using vbscript save attachment received via email shared drive. able file move expected. i cannot figure out how pull date subject line , use part of file name.
the email subject read this:
company extract 20160125
the file should named: com20160125.txt
each objmailitem in objitems 'handle each email each objatt in objmailitem.attachments 'handle multiple attachments if objmailitem.subject = |"company extract 2*"
here solution:
each objmailitem in objitems 'handle each email each objatt in objmailitem.attachments 'handle multiple attachments if instr(objmailitem.subject, "company extract 2") objatt.saveasfile network_save_location & "com" & right(objmailitem.subject,8) & ".txt"
Comments
Post a Comment