A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Reading the value of SentOnBehalfOfName of an unsent/unsaved message w/o security prompt



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 14th 06, 10:13 AM posted to microsoft.public.outlook.program_addins
Oliver Giesen
external usenet poster
 
Posts: 7
Default Reading the value of SentOnBehalfOfName of an unsent/unsaved message w/o security prompt

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
  #2  
Old August 14th 06, 03:12 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Reading the value of SentOnBehalfOfName of an unsent/unsaved message w/o security prompt

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" wrote in message
...
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


  #3  
Old August 18th 06, 12:51 PM posted to microsoft.public.outlook.program_addins
Oliver Giesen
external usenet poster
 
Posts: 7
Default Reading the value of SentOnBehalfOfName of an unsent/unsaved message w/o security prompt

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

  #4  
Old August 18th 06, 02:36 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Reading the value of SentOnBehalfOfName of an unsent/unsaved message w/o security prompt

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" wrote in message
...
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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is ItemSend really too late to set SentOnBehalfOfName ? Oliver Giesen Add-ins for Outlook 5 August 8th 06 06:19 PM
security prompt Rog Add-ins for Outlook 1 July 13th 06 05:46 AM
Error code returned when users say No to security prompt Long Nguyen Outlook - Using Forms 2 April 3rd 06 05:48 AM
I need to unblock security message RamziLakkis Outlook and VBA 2 February 23rd 06 10:37 PM
how to find an edited but unsaved attachment jgpenner Outlook Express 5 February 8th 06 01:32 PM


All times are GMT +1. The time now is 04:58 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.