How can I get active appointment dialog

S

Sky

:( I'm working on a outlook add in development, and in charge of functionalty, we need get the active appointment dialog(or object), it is like:
1. add in create a appointment and display it when user click a button in add in toolbar (as object1).
2. user type something then leave the appointment object there.
3. user click the button again, so the add in will open another appointment dialog(as object2).

I want my add in can catch the active one of the two appointment dialog (In add in, they are object both).
Just like:
When user click the title bar of the object1 dialog, my add in can get object1.
When user click the title bar of the object2 dialog, my add in can get object2.

How can I get it(In VB 6.0 SP3)?
Thank you.
 
K

Ken Slovak - [MVP - Outlook]

If there was only 1 open item you could use ActiveInspector.

In general the best practice for handling open items (Inspectors) is to wrap
each open Inspector in a wrapper class. In that class you declare and handle
all events you want for that Inspector and it's CurrentItem. You then store
each wrapper class in a collection to keep it alive. When Inspector.Close or
item.Close fire in the class you clean that class up and remove it from the
collection. That way each Inspector is handled individually.

Using that approach you would handle the Inspector.Activate event in the
wrapper class, therefore knowing which Inspector was activated.

I have a sample VB6 template using that approach and other best practices on
my Web site at http://www.slovaktech.com/outlook_2007_templates.htm. That
particular template is Outlook 2007 specific but you can use it to see how
that sort of thing is handled and change the Outlook 2007 specific
references and use of methods/properties/events for use with other versions
of Outlook.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top