Need help on Writing Macros to open email, save attachment and then close email in OL2002
Posted on 2004-11-16
I hope someone can help as i am getting very frustrated. I am new to VBA and i need to write a macro which will open up an email, save the attachment to a folder in My C drive and then close the email and return me back to my Inbox. I have managed to do the middle part using the following code: Taken from the VBA help which i run afteri doubleclick on the email it then saves the attachment in my C Drive. Which is great.
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.ActiveInspector.CurrentItem
Set myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "C:\" & _
But what i need is to be able to do click on it so that it opens saves the attachment and then closes the email. Have you any ideas as i don't seem to be getting anywhere.
I hope i have explained it clearly.