Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Saving outlook email
#1
Hello

I am trying to create a macro to save outlook attachments.

typelib Outlook {00062FFF-0000-0000-C000-000000000046} 9.2
Outlook.Application a._getactive
Outlook.Inspector i = a.ActiveInspector
Outlook.MailItem n = i.CurrentItem
Outlook.Attachments p = n.Attachments
p.Item(1).SaveAsFile("c:\taimport.txt")

when i run it it i get the error:- invalid interface pointer. Use _create or other function to create or get object

Can anyone help

Thanks
#2
It means that no inspector is active. Then ActiveInspector returns 0 (in VB it would be Nothing), and the next function tells you that it is invalid pointer. I think you should open the message in separate window.

http://msdn.microsoft.com/library/defaul...pector.asp

If the message does not have attachments, SaveAsFile fails.

I opened message with attachments in separate window, and the macro ran without errors.
#3
Thank you Gintaras

Stephanie


Forum Jump:


Users browsing this thread: 1 Guest(s)