I have to export an attachment from outlook e-mail to a folder on my drive. How could I accomplish it. I like this to be done automatically everynight. The attachment file name and name of the sender would stay the same.
Thanks a bunch. Now the code works. But there is one problem. I have to open the e-mail before it running the code in order for it to work. Is there a way that an e-mail from a particular sender is opened first automatically before running the code below:
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.ActiveInspector.CurrentItem
Set myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "C:\My Documents\" & _
myAttachments.Item(1).DisplayName
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.