Re: How to intercept the "ItemEvents"
From: Dmitry Streblechenko \(MVP\) (dmitry_at_dimastr.com)
Date: 08/05/04
- Next message: Dmitry Streblechenko \(MVP\): "Re: How to get Exchange/SMTP address from 'Distinguish Name' from Outlook mail Item"
- Previous message: Dmitry Streblechenko \(MVP\): "Re: Redemption Send/Drafts problem"
- In reply to: Alexander Chen: "Re: How to intercept the "ItemEvents""
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 5 Aug 2004 15:06:29 -0700
You will get what you have now - your handler will be called multiple times.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Alexander Chen" <elpelado001@hotmail.com> wrote in message
news:O1VZiSseEHA.724@TK2MSFTNGP10.phx.gbl...
> If I don't set tag for each instance of the button, will it bring my addin
> any bad influence ?
>
>
> "Dmitry Streblechenko (MVP)" <dmitry@dimastr.com> wrote in message
> news:u$5xuWqeEHA.3840@TK2MSFTNGP10.phx.gbl...
> > You need to set the CommandBarButton.Tag property to a unique string for
> > each instance of the button.
> >
> > Dmitry Streblechenko (MVP)
> > http://www.dimastr.com/
> > OutlookSpy - Outlook, CDO
> > and MAPI Developer Tool
> >
> >
> > "Alexander Chen" <elpelado001@hotmail.com> wrote in message
> > news:%23fHKAbpeEHA.2440@tk2msftngp13.phx.gbl...
> > >
> > > I want to ask you another question. you said "you need to have
> separately
> > > > advise sinks for each instance of a button since you can have
multiple
> > > > inspectors or explorers open". But in my project, I can only advise
> sink
> > > for a button once, although I have multiple inspectors open. If I
> adivise
> > > sinks for each instance of a button in multiple inspectors, in the
first
> > > inpector,the button runs ok, but in the second inspector, the button
> will
> > > respond for a click twice, in the third, it will respond the event
> thrice.
> > > Why? By the way, I do not appoint tag for the button .
> > >
> > >
> > > "Dmitry Streblechenko (MVP)" <dmitry@dimastr.com> wrote in message
> > > news:#abvxbYeEHA.708@TK2MSFTNGP09.phx.gbl...
> > > > If you want to intercept the events on all messages, you'd have to
set
> > > > advise sinks on each message that you want to monitor, there is no
way
> > > > around it.
> > > > What kind of events are you trying to intercept? If it is something
> > caused
> > > > by a user, track Explorer.SelectionChange event, release old advise
> > sinks,
> > > > then set new advise sinks on each selected message. Or you can use
the
> > > > MAPIFolder.Items events on each folder that you are interested in.
> > > > And BTW, buttons are exactly like messages - you need to have
separate
> > > > advise sinks for each instance of a button since you can have
multiple
> > > > inspectors or explorers open.
> > > >
> > > > Dmitry Streblechenko (MVP)
> > > > http://www.dimastr.com/
> > > > OutlookSpy - Outlook, CDO
> > > > and MAPI Developer Tool
> > > >
> > > >
> > > > "Alexander Chen" <elpelado001@hotmail.com> wrote in message
> > > > news:eCovE8ReEHA.2764@TK2MSFTNGP11.phx.gbl...
> > > > > I want to intercept Outlook::ItemEvents triggerd by
> _MailItem
> > > > > objects in my addin,but I encounter a difficulty. if I use
> > > > > IDispEventSimpleImpl or IDispEventImpl in my addin class, I must
> > specify
> > > a
> > > > > unique identifier for every _MailItem object. You know, the
> _MailItem
> > > > object
> > > > > does not like the button object, its number can change and it also
> can
> > > be
> > > > > created or destroyed during using outlook, so I can not specify a
> > > > identifier
> > > > > for every _MailItem object when I implement my addin class.
> > > > > Who can help me resolve this difficulty?
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: Dmitry Streblechenko \(MVP\): "Re: How to get Exchange/SMTP address from 'Distinguish Name' from Outlook mail Item"
- Previous message: Dmitry Streblechenko \(MVP\): "Re: Redemption Send/Drafts problem"
- In reply to: Alexander Chen: "Re: How to intercept the "ItemEvents""
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|