Outlook Address Managing

  • Thread starter Thread starter À±Çüµ¿
  • Start date Start date
À

À±Çüµ¿

I'm wokring on a mail-address-managing program.

One of the functions of this program is managing(saving, removing and
modifying)
the input mail address of Outlook. And another one is alarming or
auto-modifying
of the wrong-formed input mail address.

I am working on it with VC++ (or VB), and I got to the point of getting
ItemSendInfo event of ApplicationEvents and NewInspectorInfo event
of InspectorsEvents.
But I got a problem. When a wrong-formed mail was input, Outlook searches
the address book and changes the input in case of any result, and in case
of no result,
it prints error code.


For example, the wrong-formed input was 'aaa@bbb', Outlook searches the
address
book with 'aaa@bbb' and if there is no result, it prints error messages
and
ItemSendInfo event of ApplicationEvents occures.



I have 3 questions.

1. When sending a mail, I want to get the event before the
program(Outlook) searches
the address book. What event should I use?

2. How can I get the input mail address (by the user)?
I heard 'MailItem' would do,,, is this right?

3. I want to modify the input mail address. I heard that I have to access
the address book.
Is this right? And if it is, is there any example code?


Thank you for reading...
 
There's a MaiItem.BeforeCheckNames event but it's buggy and often
doesn't fire. If you want to see information on what methods,
properties and events are available for various Outlook items and
collections use the Object Browser. You could trap the MailItem.Send
event and check the addresses yourself using the Resolve method on
individual Recipients or the ResolveAll method for the Recipients
collection and then test Resolved for each Recipient.

The sender's address in an email you are sending out is not actually
added to the item until the message transport mechanism is called
after the send and at that point the item isn't accessible as a
MailItem. You can set the SentOnBehalfOfName property but otherwise
you can't control the From address unless you use CDO 1.21 code (not
real good from DotNet) or Extended MAPI or Redemption
(www.dimastr.com/redemption).
 
Back
Top