Board index » delphi » Outlook (still): manipulating new (outgoing) message's properties

Outlook (still): manipulating new (outgoing) message's properties

Now, this should be the very last hurdle... Promise. ;)

I'm trying to manipulate some properties of a new message (Subject,
SentOnBehalfOfName, etc.). This is already working fine for replies and
forwards which I implemented by hooking into the item's OnReply(All)/Forward
events.
Now however a similar requirement has been added for entirely new mails. The
best place I could find so far for hooking into was the OnNewInspector event
(of the Inspectors collection) and then using the inspector's CurrentItem
property. However, assigning values to any of the sender or recipient fields
(with the exact same code I already use successfully for replies and
forwards) of that item has no effect whatsoever (I could set the subject
though). It's as if they were still in a read-only state at the moment I'm
trying to write to them.
I have also already tried to react to this new item's OnOpen event and doing
my stuff there but to no avail. Setting the properties at the MAPI level
instead of the OOM is just the same, although in this case I am able to see
the values I have set using OutlookSpy. They obviously get discarded upon
send though... Oh, yes and calling Save doesn't help as well, no matter
where I put it.

Any ideas?

Oliver
---- ------------------
JID: ogie...@jabber.org
ICQ: 18777742
      (http://wwp.icq.com/18777742)

 

Re:Outlook (still): manipulating new (outgoing) message's properties


What is your code? Do you add recipients using OOM? Note that setting To/CC/BCC
properties directly (instead of using the Recipients collection) on the OOM
objects will not cause the security prompts since only reading is blocked.

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

Quote
"Oliver Giesen" <ogw...@gmx.net> wrote in message

news:3efb861a@newsgroups.borland.com...
Quote
> Now, this should be the very last hurdle... Promise. ;)

> I'm trying to manipulate some properties of a new message (Subject,
> SentOnBehalfOfName, etc.). This is already working fine for replies and
> forwards which I implemented by hooking into the item's OnReply(All)/Forward
> events.
> Now however a similar requirement has been added for entirely new mails. The
> best place I could find so far for hooking into was the OnNewInspector event
> (of the Inspectors collection) and then using the inspector's CurrentItem
> property. However, assigning values to any of the sender or recipient fields
> (with the exact same code I already use successfully for replies and
> forwards) of that item has no effect whatsoever (I could set the subject
> though). It's as if they were still in a read-only state at the moment I'm
> trying to write to them.
> I have also already tried to react to this new item's OnOpen event and doing
> my stuff there but to no avail. Setting the properties at the MAPI level
> instead of the OOM is just the same, although in this case I am able to see
> the values I have set using OutlookSpy. They obviously get discarded upon
> send though... Oh, yes and calling Save doesn't help as well, no matter
> where I put it.

> Any ideas?

> Oliver
> ---- ------------------
> JID: ogie...@jabber.org
> ICQ: 18777742
>       (http://wwp.icq.com/18777742)

Other Threads