A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook 2003 New Mail Inspector Q



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 7th 06, 10:19 PM posted to microsoft.public.outlook.program_addins
jpuopolo
external usenet poster
 
Posts: 4
Default Outlook 2003 New Mail Inspector Q

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

Ads
  #2  
Old September 7th 06, 11:56 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook 2003 New Mail Inspector Q

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" wrote in message
ups.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



  #3  
Old September 8th 06, 01:52 AM posted to microsoft.public.outlook.program_addins
jpuopolo
external usenet poster
 
Posts: 4
Default Outlook 2003 New Mail Inspector Q

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" wrote in message
ups.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


  #4  
Old September 8th 06, 06:38 AM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook 2003 New Mail Inspector Q

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" wrote in message
ups.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" wrote in message
ups.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




  #5  
Old September 8th 06, 01:59 PM posted to microsoft.public.outlook.program_addins
jpuopolo
external usenet poster
 
Posts: 4
Default Outlook 2003 New Mail Inspector Q

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" wrote in message
ups.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" wrote in message
ups.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



  #6  
Old September 8th 06, 06:17 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Outlook 2003 New Mail Inspector Q

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" wrote in message
ups.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" wrote in message
ups.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" wrote in message
ups.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





  #7  
Old September 12th 06, 01:49 AM posted to microsoft.public.outlook.program_addins
jpuopolo
external usenet poster
 
Posts: 4
Default Outlook 2003 New Mail Inspector Q

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:
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" wrote in message
ups.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" wrote in message
ups.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" wrote in message
ups.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




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inspector outdated DanielH Outlook and VBA 4 May 4th 06 06:53 PM
Windows form in Inspector Rog Add-ins for Outlook 1 March 17th 06 02:55 PM
Transparent Inspector images Rog Add-ins for Outlook 7 March 15th 06 09:52 PM
Help! Inspector.Close is fired before Inspector.Activate handler finishes Sergey Anchipolevsky Add-ins for Outlook 8 February 9th 06 09:51 AM
Outlook 2003 fires an Inspector Close when a send is cancelled Steve D Add-ins for Outlook 8 February 8th 06 11:22 PM


All times are GMT +1. The time now is 08:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.