Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Outlook 2003 New Mail Inspector Q

Geek News

Outlook 2003 New Mail Inspector Q
"jpuopolo" <jpuopolo[ at ]hotmail.com> 9/7/2006 9:19:37 PM
All:

I have developed an Outlook 2003 Add-In (VSTO/.NET/C#) that recognizes
when a new mail Inspector is created - it attaches a menu and things
work fine.

I would like to be able, when the user click on my menu, to read the
names in the To and CC fields of the new mail (prior to any Send event
being triggered).

How can my add-in access to the To and CC edit fields of the New Mail
window/inspector/explorer?

Many thanks,
John

Re: Outlook 2003 New Mail Inspector Q
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 9/7/2006 10:56:55 PM
Inspector.CurrentItem will return the current MailItem object (unless your
code works with other items too). From there you can loop through all the
recipients in the MailItem.Recipients collection. The recipient kind
(olTo/olCC/olBCC) is returned by the Recipient.Type property.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
news:1157663977.673633.175910[ at ]i3g2000cwc.googlegroups.com...
[Quoted Text]
> All:
>
> I have developed an Outlook 2003 Add-In (VSTO/.NET/C#) that recognizes
> when a new mail Inspector is created - it attaches a menu and things
> work fine.
>
> I would like to be able, when the user click on my menu, to read the
> names in the To and CC fields of the new mail (prior to any Send event
> being triggered).
>
> How can my add-in access to the To and CC edit fields of the New Mail
> window/inspector/explorer?
>
> Many thanks,
> John
>


Re: Outlook 2003 New Mail Inspector Q
"jpuopolo" <jpuopolo[ at ]hotmail.com> 9/8/2006 12:52:22 AM
Dmitry:

My MailItem.Recipients list is empty -- even though I have several
names in the To field.
I am accessing the MailItem via:

Outlook.MailItem mailItem = ActiveInspector().CurrentItem as
Outlook.MailItem;

And when the mailItem is non-null, I attempt to loop through the
Recipients collection - which contains 0 names...

Thoughts?

Do I need to somehow access the actual edit pane the recipient text is
in? How?

John


Dmitry Streblechenko wrote:
[Quoted Text]
> Inspector.CurrentItem will return the current MailItem object (unless your
> code works with other items too). From there you can loop through all the
> recipients in the MailItem.Recipients collection. The recipient kind
> (olTo/olCC/olBCC) is returned by the Recipient.Type property.
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
> news:1157663977.673633.175910[ at ]i3g2000cwc.googlegroups.com...
> > All:
> >
> > I have developed an Outlook 2003 Add-In (VSTO/.NET/C#) that recognizes
> > when a new mail Inspector is created - it attaches a menu and things
> > work fine.
> >
> > I would like to be able, when the user click on my menu, to read the
> > names in the To and CC fields of the new mail (prior to any Send event
> > being triggered).
> >
> > How can my add-in access to the To and CC edit fields of the New Mail
> > window/inspector/explorer?
> >
> > Many thanks,
> > John
> >

Re: Outlook 2003 New Mail Inspector Q
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 9/8/2006 5:38:31 AM
Are these recipients resolved? When do you call that code?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
news:1157676742.515491.29220[ at ]p79g2000cwp.googlegroups.com...
[Quoted Text]
> Dmitry:
>
> My MailItem.Recipients list is empty -- even though I have several
> names in the To field.
> I am accessing the MailItem via:
>
> Outlook.MailItem mailItem = ActiveInspector().CurrentItem as
> Outlook.MailItem;
>
> And when the mailItem is non-null, I attempt to loop through the
> Recipients collection - which contains 0 names...
>
> Thoughts?
>
> Do I need to somehow access the actual edit pane the recipient text is
> in? How?
>
> John
>
>
> Dmitry Streblechenko wrote:
>> Inspector.CurrentItem will return the current MailItem object (unless
>> your
>> code works with other items too). From there you can loop through all the
>> recipients in the MailItem.Recipients collection. The recipient kind
>> (olTo/olCC/olBCC) is returned by the Recipient.Type property.
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
>> news:1157663977.673633.175910[ at ]i3g2000cwc.googlegroups.com...
>> > All:
>> >
>> > I have developed an Outlook 2003 Add-In (VSTO/.NET/C#) that recognizes
>> > when a new mail Inspector is created - it attaches a menu and things
>> > work fine.
>> >
>> > I would like to be able, when the user click on my menu, to read the
>> > names in the To and CC fields of the new mail (prior to any Send event
>> > being triggered).
>> >
>> > How can my add-in access to the To and CC edit fields of the New Mail
>> > window/inspector/explorer?
>> >
>> > Many thanks,
>> > John
>> >
>


Re: Outlook 2003 New Mail Inspector Q
"jpuopolo" <jpuopolo[ at ]hotmail.com> 9/8/2006 12:59:15 PM
Dmitry:

I get a resolved name (I type in someone's name to whom I have sent an
e-mail before, and I get the resolved name - at least it appears to be
a resolved name).

I make this call when the user selects my custom menu. The command
handler needs to get whatever text is in the "To" and "CC" fields of
the New Mail Item window. The names may or may not be resolved.

Maybe I need to actually access the window/pane or something where the
text resides?

John


Dmitry Streblechenko wrote:
[Quoted Text]
> Are these recipients resolved? When do you call that code?
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
> news:1157676742.515491.29220[ at ]p79g2000cwp.googlegroups.com...
> > Dmitry:
> >
> > My MailItem.Recipients list is empty -- even though I have several
> > names in the To field.
> > I am accessing the MailItem via:
> >
> > Outlook.MailItem mailItem = ActiveInspector().CurrentItem as
> > Outlook.MailItem;
> >
> > And when the mailItem is non-null, I attempt to loop through the
> > Recipients collection - which contains 0 names...
> >
> > Thoughts?
> >
> > Do I need to somehow access the actual edit pane the recipient text is
> > in? How?
> >
> > John
> >
> >
> > Dmitry Streblechenko wrote:
> >> Inspector.CurrentItem will return the current MailItem object (unless
> >> your
> >> code works with other items too). From there you can loop through all the
> >> recipients in the MailItem.Recipients collection. The recipient kind
> >> (olTo/olCC/olBCC) is returned by the Recipient.Type property.
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
> >> news:1157663977.673633.175910[ at ]i3g2000cwc.googlegroups.com...
> >> > All:
> >> >
> >> > I have developed an Outlook 2003 Add-In (VSTO/.NET/C#) that recognizes
> >> > when a new mail Inspector is created - it attaches a menu and things
> >> > work fine.
> >> >
> >> > I would like to be able, when the user click on my menu, to read the
> >> > names in the To and CC fields of the new mail (prior to any Send event
> >> > being triggered).
> >> >
> >> > How can my add-in access to the To and CC edit fields of the New Mail
> >> > window/inspector/explorer?
> >> >
> >> > Many thanks,
> >> > John
> >> >
> >

Re: Outlook 2003 New Mail Inspector Q
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 9/8/2006 5:17:46 PM
What happens if you click away from that To/CC/BCC edit to, say, the body of
the message, and only then click your custom menu?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
news:1157720355.313978.17200[ at ]m79g2000cwm.googlegroups.com...
[Quoted Text]
> Dmitry:
>
> I get a resolved name (I type in someone's name to whom I have sent an
> e-mail before, and I get the resolved name - at least it appears to be
> a resolved name).
>
> I make this call when the user selects my custom menu. The command
> handler needs to get whatever text is in the "To" and "CC" fields of
> the New Mail Item window. The names may or may not be resolved.
>
> Maybe I need to actually access the window/pane or something where the
> text resides?
>
> John
>
>
> Dmitry Streblechenko wrote:
>> Are these recipients resolved? When do you call that code?
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> "jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
>> news:1157676742.515491.29220[ at ]p79g2000cwp.googlegroups.com...
>> > Dmitry:
>> >
>> > My MailItem.Recipients list is empty -- even though I have several
>> > names in the To field.
>> > I am accessing the MailItem via:
>> >
>> > Outlook.MailItem mailItem = ActiveInspector().CurrentItem as
>> > Outlook.MailItem;
>> >
>> > And when the mailItem is non-null, I attempt to loop through the
>> > Recipients collection - which contains 0 names...
>> >
>> > Thoughts?
>> >
>> > Do I need to somehow access the actual edit pane the recipient text is
>> > in? How?
>> >
>> > John
>> >
>> >
>> > Dmitry Streblechenko wrote:
>> >> Inspector.CurrentItem will return the current MailItem object (unless
>> >> your
>> >> code works with other items too). From there you can loop through all
>> >> the
>> >> recipients in the MailItem.Recipients collection. The recipient kind
>> >> (olTo/olCC/olBCC) is returned by the Recipient.Type property.
>> >>
>> >> Dmitry Streblechenko (MVP)
>> >> http://www.dimastr.com/
>> >> OutlookSpy - Outlook, CDO
>> >> and MAPI Developer Tool
>> >>
>> >> "jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
>> >> news:1157663977.673633.175910[ at ]i3g2000cwc.googlegroups.com...
>> >> > All:
>> >> >
>> >> > I have developed an Outlook 2003 Add-In (VSTO/.NET/C#) that
>> >> > recognizes
>> >> > when a new mail Inspector is created - it attaches a menu and things
>> >> > work fine.
>> >> >
>> >> > I would like to be able, when the user click on my menu, to read the
>> >> > names in the To and CC fields of the new mail (prior to any Send
>> >> > event
>> >> > being triggered).
>> >> >
>> >> > How can my add-in access to the To and CC edit fields of the New
>> >> > Mail
>> >> > window/inspector/explorer?
>> >> >
>> >> > Many thanks,
>> >> > John
>> >> >
>> >
>


Re: Outlook 2003 New Mail Inspector Q
"jpuopolo" <jpuopolo[ at ]hotmail.com> 9/12/2006 12:49:29 AM
Dmitry:

Hi.. Thanks for the follow up. I actually solved the problem by called
myMailItem.Save() before trying to access the To, CC, and BCC fields.
Once the item is saved (by default to the Drafts folder), everything
works well - the only side effect being a copy of the message is in the
Drafts folder.

Best,
John

Dmitry Streblechenko wrote:
[Quoted Text]
> What happens if you click away from that To/CC/BCC edit to, say, the body of
> the message, and only then click your custom menu?
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> "jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
> news:1157720355.313978.17200[ at ]m79g2000cwm.googlegroups.com...
> > Dmitry:
> >
> > I get a resolved name (I type in someone's name to whom I have sent an
> > e-mail before, and I get the resolved name - at least it appears to be
> > a resolved name).
> >
> > I make this call when the user selects my custom menu. The command
> > handler needs to get whatever text is in the "To" and "CC" fields of
> > the New Mail Item window. The names may or may not be resolved.
> >
> > Maybe I need to actually access the window/pane or something where the
> > text resides?
> >
> > John
> >
> >
> > Dmitry Streblechenko wrote:
> >> Are these recipients resolved? When do you call that code?
> >>
> >> Dmitry Streblechenko (MVP)
> >> http://www.dimastr.com/
> >> OutlookSpy - Outlook, CDO
> >> and MAPI Developer Tool
> >>
> >> "jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
> >> news:1157676742.515491.29220[ at ]p79g2000cwp.googlegroups.com...
> >> > Dmitry:
> >> >
> >> > My MailItem.Recipients list is empty -- even though I have several
> >> > names in the To field.
> >> > I am accessing the MailItem via:
> >> >
> >> > Outlook.MailItem mailItem = ActiveInspector().CurrentItem as
> >> > Outlook.MailItem;
> >> >
> >> > And when the mailItem is non-null, I attempt to loop through the
> >> > Recipients collection - which contains 0 names...
> >> >
> >> > Thoughts?
> >> >
> >> > Do I need to somehow access the actual edit pane the recipient text is
> >> > in? How?
> >> >
> >> > John
> >> >
> >> >
> >> > Dmitry Streblechenko wrote:
> >> >> Inspector.CurrentItem will return the current MailItem object (unless
> >> >> your
> >> >> code works with other items too). From there you can loop through all
> >> >> the
> >> >> recipients in the MailItem.Recipients collection. The recipient kind
> >> >> (olTo/olCC/olBCC) is returned by the Recipient.Type property.
> >> >>
> >> >> Dmitry Streblechenko (MVP)
> >> >> http://www.dimastr.com/
> >> >> OutlookSpy - Outlook, CDO
> >> >> and MAPI Developer Tool
> >> >>
> >> >> "jpuopolo" <jpuopolo[ at ]hotmail.com> wrote in message
> >> >> news:1157663977.673633.175910[ at ]i3g2000cwc.googlegroups.com...
> >> >> > All:
> >> >> >
> >> >> > I have developed an Outlook 2003 Add-In (VSTO/.NET/C#) that
> >> >> > recognizes
> >> >> > when a new mail Inspector is created - it attaches a menu and things
> >> >> > work fine.
> >> >> >
> >> >> > I would like to be able, when the user click on my menu, to read the
> >> >> > names in the To and CC fields of the new mail (prior to any Send
> >> >> > event
> >> >> > being triggered).
> >> >> >
> >> >> > How can my add-in access to the To and CC edit fields of the New
> >> >> > Mail
> >> >> > window/inspector/explorer?
> >> >> >
> >> >> > Many thanks,
> >> >> > John
> >> >> >
> >> >
> >

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net