Thread: Running a macro
View Single Post
  #15  
Old February 7th 06, 10:01 PM posted to microsoft.public.outlook.program_forms
SuperSlueth
external usenet poster
 
Posts: 24
Default Running a macro

On Mon, 6 Feb 2006 16:47:44 -0500, "Sue Mosher [MVP-Outlook]"
wrote:

You might be confusing the MailItem.Open method and the MailItem.Open event. If you declare a MailItem object WithEvents and then instantiate it so that object represents a specific message, then the Open even fires when that message opens on the screen, whether the user does it manually or code does it programmatically. At that point, you should have access to the MailItem object's Attachments collection, but the message will not be displayed yet.

You might find the Inspector.Activate event works better for your scenario. It fires when the Inspector becomes the active window, which means it has displayed.



At last it working .... almost.

I need to open 1 email first, then there after it works ok.

Can you suggest a method in code of opening and closing an email.

It can be any mail.

Thanks for all your time
Ads