getting send email in outlook 2002

M

mr

In Outlook 2002 there is no SenderEmailAddress, so i am trying to use the
suggestion in KB 324530 OL: How to Programmatically Retrieve Fully Qualified
E-mail Addresses,
The suggestion there is to create a reply and then get the email address
from the reply message:
I have created the code shown below to do just that. i create the reply but
the recipient collection is empty! am i leaving out a step?

MailItem mi = null;
MailItem miReply = null;
Microsoft.Office.Interop.Outlook.Recipients recips = null;

Microsoft.Office.Interop.Outlook.Explorer ox =
applicationObject.ActiveExplorer();
mi = ox.Selection[1] as MailItem;
miReply = mi.Reply();
recips = miReply.ReplyRecipients;

recips.count equals 0!
what am i doing wrong?

(p.s. is there a way to avoid the security message that pops up when you
access the sender information?)
 
K

Ken Slovak - [MVP - Outlook]

Why are you using miReply.ReplyRecipients? The original code uses
miReply.Recipients.

BTW, that would only work correctly if a) the reply recipient had been set
for the original mail item and b)the reply address was the same as the
sender address, it doesn't have to be.

Your options for avoiding the security prompts are listed at
http://www.outlookcode.com/d/sec.htm
 
M

mr

oops. i can't beleive i didn't catch that. thanks

Ken Slovak - said:
Why are you using miReply.ReplyRecipients? The original code uses
miReply.Recipients.

BTW, that would only work correctly if a) the reply recipient had been set
for the original mail item and b)the reply address was the same as the
sender address, it doesn't have to be.

Your options for avoiding the security prompts are listed at
http://www.outlookcode.com/d/sec.htm




mr said:
In Outlook 2002 there is no SenderEmailAddress, so i am trying to use the
suggestion in KB 324530 OL: How to Programmatically Retrieve Fully
Qualified
E-mail Addresses,
The suggestion there is to create a reply and then get the email address
from the reply message:
I have created the code shown below to do just that. i create the reply
but
the recipient collection is empty! am i leaving out a step?

MailItem mi = null;
MailItem miReply = null;
Microsoft.Office.Interop.Outlook.Recipients recips = null;

Microsoft.Office.Interop.Outlook.Explorer ox =
applicationObject.ActiveExplorer();
mi = ox.Selection[1] as MailItem;
miReply = mi.Reply();
recips = miReply.ReplyRecipients;

recips.count equals 0!
what am i doing wrong?

(p.s. is there a way to avoid the security message that pops up when you
access the sender information?)
 

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