PC Review


Reply
Thread Tools Rate Thread

Add-In and custom form code

 
 
=?Utf-8?B?U2VsZ2lu?=
Guest
Posts: n/a
 
      30th Jan 2004
Hi

I developed a COM-Addin in Outlook 2000 that sets the value of a user-defined field in a custom email form in the inbox item_add event ie. when the email arrives

In the custom form itself, in the Item_Read event, I have vbscript code that reads the value of this custom field set by add-in, and formats some labels in the read form (bold etc..) accordingly

The problem I am having is that the first time the message is opened by the user, the formatting logic in the form code doesn't execute properly. However, on subsequent openings it works fine.

In my testing I have come to the conclude that since the Item_Read event is triggered when a message arrives, and not just when selected or opened, at this point the add-in hasn't yet had time to do its job (set the custom value), thus causing the form code to read nothing in the custom fields value. But when opening the form a second and subsequent times, the value is there and code is executed correcly

My question is, is there a way around this? My understanding is that I cannot do the label formatting in the add-in itself because Outlook will refer to the published forms definition when opening the form, tus it won't be permanent formatting for each email

Or is it simply how Outlook works and thats it? Hope I was clear

Thanks

Selgin
 
Reply With Quote
 
 
 
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      30th Jan 2004
You should be using the Item_Open event to make your UI changes, not
Item_Read.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Selgin" <(E-Mail Removed)> wrote in message
news:C452271D-5FA4-4626-87E1-(E-Mail Removed)...
> Hi,
>
> I developed a COM-Addin in Outlook 2000 that sets the value of a

user-defined field in a custom email form in the inbox item_add event ie.
when the email arrives.
>
> In the custom form itself, in the Item_Read event, I have vbscript code

that reads the value of this custom field set by add-in, and formats some
labels in the read form (bold etc..) accordingly.
>
> The problem I am having is that the first time the message is opened by

the user, the formatting logic in the form code doesn't execute properly.
However, on subsequent openings it works fine.
>
> In my testing I have come to the conclude that since the Item_Read event

is triggered when a message arrives, and not just when selected or opened,
at this point the add-in hasn't yet had time to do its job (set the custom
value), thus causing the form code to read nothing in the custom fields
value. But when opening the form a second and subsequent times, the value is
there and code is executed correcly.
>
> My question is, is there a way around this? My understanding is that I

cannot do the label formatting in the add-in itself because Outlook will
refer to the published forms definition when opening the form, tus it won't
be permanent formatting for each email.


 
Reply With Quote
 
=?Utf-8?B?U2VsZ2lu?=
Guest
Posts: n/a
 
      30th Jan 2004
Did the trick nicely, thank you Sue

----- Sue Mosher [MVP] wrote: ----

You should be using the Item_Open event to make your UI changes, no
Item_Read
--
Sue Mosher, Outlook MV
Author o
Microsoft Outlook Programming - Jumpstart fo
Administrators, Power Users, and Developer
http://www.outlookcode.com/jumpstart.asp



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom form code not firing karlman Microsoft Outlook Form Programming 10 4th Jan 2008 11:38 AM
Custom form code not firing karlman Microsoft Outlook VBA Programming 1 2nd Jan 2008 09:53 PM
Custom Form Code Joel Allen Microsoft Outlook VBA Programming 5 15th Aug 2007 03:20 AM
Custom Menu Code In Form?? Judy Microsoft Access Form Coding 2 28th Nov 2004 03:03 AM
How to generate custom code in the "Windows Form Designer generated code" section =?Utf-8?B?Lk5ldCBEZXZlbG9wZXI=?= Microsoft Dot NET Framework Forms 3 3rd May 2004 03:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:24 PM.