Map a drive based on a URL in an email using VBA

Răspuns Map a drive based on a URL in an email using VBA

  • 5 aprilie 2012 10:28
     
     

    Hi,

    I can't figure out how to extract specific text from an email body to use in another command, I hope someone can help me with this!

    Every week users receive an email with a link to a new location for backing up files.

    The format of the email and the url is constant "\\domain\path_date_uniqueID"

    The subject is always the same. "Your archive area is now available PLEASE ACTION"

    Outlook 2010 & 2003 (migration in process)

    I am trying to get the script to extract the URL and mount it to drive Z and then start the ntbackup proces.

    Somehow I can't get this to work at all...Usually I work with VBA within excel and I can figure out almost everything I want to accomplish, but somehow this issue is beyond me!

    Thanks!

    Tom

Toate mesajele

  • 5 aprilie 2012 11:26
     
     Răspuns

    get inspector for mail, check IsWordMail (for 2010 always true) and if so, access WordEditor and interate HyperLinks collection, grab from there your link and simply call shell execute to map drive. If mail is simple text or html your task of extracting hypelink if even easier.