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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -