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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -