Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Reading the value of SentOnBehalfOfName of an unsent/unsaved message w/o security prompt

Geek News

Reading the value of SentOnBehalfOfName of an unsent/unsaved message w/o security prompt
"Oliver Giesen" <NO.ogware.SPAM[ at ]gmx.ALLOWED.net.INVALID> 8/14/2006 9:13:27 AM
Hi all!

I need to check the value of a mail item's SentOnBehalfOfName (aka
"From") before it gets sent (e.g. from BeforeCheckNames or ItemSend). I
am already using Redemption to circumvent the security prompts but the
problem seems to be that at the moment when I perform the check Outlook
has not yet persisted the value anywhere that Redemption can access it.
Accessing it without Redemption works but gives me the security prompt.
I already tried reading the value directly from the text box using
WM_GETTEXT but even that only returns an empty string if the sender has
already been resolved (at least in OL2003 - haven't checked the earlier
versions yet). Needless to say that the underlying MAPI properties
(i.e. PR_SENT_REPRESENTING_*) have not been set at that stage either.

Any other ideas besides sending mouse click messages to the security
prompt?

Cheers,

Oliver
Re: Reading the value of SentOnBehalfOfName of an unsent/unsaved message w/o security prompt
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 8/14/2006 2:12:44 PM
Have you tried saving the item?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Oliver Giesen" <NO.ogware.SPAM[ at ]gmx.ALLOWED.net.INVALID> wrote in message
news:xn0epymy25b96p000[ at ]news.microsoft.com...
[Quoted Text]
> Hi all!
>
> I need to check the value of a mail item's SentOnBehalfOfName (aka
> "From") before it gets sent (e.g. from BeforeCheckNames or ItemSend). I
> am already using Redemption to circumvent the security prompts but the
> problem seems to be that at the moment when I perform the check Outlook
> has not yet persisted the value anywhere that Redemption can access it.
> Accessing it without Redemption works but gives me the security prompt.
> I already tried reading the value directly from the text box using
> WM_GETTEXT but even that only returns an empty string if the sender has
> already been resolved (at least in OL2003 - haven't checked the earlier
> versions yet). Needless to say that the underlying MAPI properties
> (i.e. PR_SENT_REPRESENTING_*) have not been set at that stage either.
>
> Any other ideas besides sending mouse click messages to the security
> prompt?
>
> Cheers,
>
> Oliver

Re: Reading the value of SentOnBehalfOfName of an unsent/unsaved message w/o security prompt
"Oliver Giesen" <NO.ogware.SPAM[ at ]gmx.ALLOWED.net.INVALID> 8/18/2006 11:51:40 AM
Ken Slovak - [MVP - Outlook] wrote:

[Quoted Text]
> Have you tried saving the item?

Thanks, that works indeed but in my situation it requires a whole lot
of extra code to keep the user's Draft folder clean: In certain
situations I might cancel the send based on my checks and in that case
the saved item would remain in the Draft folder... I think I got all
eventualities (e.g. user-invoked saves) sorted out now but it still
feels like a bit of a hack. Is there maybe some proven solution to this
(quite common?) dilemma?

Cheers,

Oliver

Re: Reading the value of SentOnBehalfOfName of an unsent/unsaved message w/o security prompt
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 8/18/2006 1:36:25 PM
Yeah, set a flag when you save an item, checking its .Saved status first. If
previously unsaved your flag reflects that. When the Item_Write event fires
if your flag indicates that you saved the item you clear the flag and set
another one to indicate that Write fired. Then on Close you can get and
delete the item from Drafts if necessary.

There's nothing but doing some sort of hack for this situation where you
need to save an item to get various properties or the attachments or
recipients tables.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Oliver Giesen" <NO.ogware.SPAM[ at ]gmx.ALLOWED.net.INVALID> wrote in message
news:xn0eq4dbjady53000[ at ]news.microsoft.com...
[Quoted Text]
> Ken Slovak - [MVP - Outlook] wrote:
>
>> Have you tried saving the item?
>
> Thanks, that works indeed but in my situation it requires a whole lot
> of extra code to keep the user's Draft folder clean: In certain
> situations I might cancel the send based on my checks and in that case
> the saved item would remain in the Draft folder... I think I got all
> eventualities (e.g. user-invoked saves) sorted out now but it still
> feels like a bit of a hack. Is there maybe some proven solution to this
> (quite common?) dilemma?
>
> Cheers,
>
> Oliver
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net