I am trying to design a VB Script which will read the .exe fie location based on the Outlook email notification, copy that and paste it to a designated location on the hard drive. Is this feasible, if yes what would be the approach to follow ?
Answer by Rich Text · Feb 18, 2015 at 07:43 PM
It should be possible using the Outlook.Application object. I'm not exactly sure how you intend to use the path for saving or what format the email will be in, but here a short example:
Set myOlApp = CreateObject("Outlook.Application") Set myItem = Me.Explorers.Item(1).Selection.Item(1) myItem.SaveAs "<Path>" & myItem.Subject & ".msg", olMSG
There is a very good (and lengthy) discussion on this with some function code that sounds exactly like what you described. You should be able to use the functions at the below site to give you a working example that you can modify to your own needs:
No script debugger in UFT 5 Answers