View Single Post
  #3  
Old May 4th 06, 07:00 PM posted to microsoft.public.outlook.program_vba
DanielH
external usenet poster
 
Posts: 6
Default Inspector outdated

Can you please give me an example.
If I could get the final eMail-Adress which will be used this would be even
better.

"Dmitry Streblechenko" wrote:

You need to be checking the named MAPI properties set on the message when
you select an account rather than check the state of the dropdown control on
the inspector.

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

"DanielH" wrote in message
...
Hi,

I am using the following code in my ItemSend-notification to get the name
of
the account from which the current eMail will be sent [C#-Plugin]:
void applicationObject_ItemSend(object oItem, ref bool Cancel)
{
Outlook.MailItem Item = oItem as Outlook.MailItem;
string senderAddress = "";
Outlook.Inspector OLI = Item.GetInspector;
CommandBars CBs;
CommandBarPopup CBP;
object ID_ACCOUNTS = 31224;
if(OLI==null)
return;
CBs = OLI.CommandBars;
object type = 10;
object visible = 1;
CBP = CBs.FindControl(type, ID_ACCOUNTS, null, visible) as
CommandBarPopup;
if(CBP == null)
return;
object index = 1;
CommandBarControl MC = CBP.Controls[index];
int pos = MC.Caption.IndexOf(' ');
if(pos = 0)
senderAddress = MC.Caption.Substring(0, pos);
else
senderAddress = MC.Caption;


Actually, this kind of works, but I am always one iteration behind.
Imagine,
I change from default to account2, then click Send, I will receive
Default.
Changing it again to account2, I will get account2.
Anyone knows this problem? Any workaround?

Kind regards,
Daniel




Ads