Custom form Item_Open event not getting called....

G

Guest

I have a custom contact form that I populate upon the Item_Open event. However, this event is not getting called every time the form is loaded. For example, if I make a change to the form, then close the form using the 'X' in the top right corner, I get a message box asking if I want to save the changes made. Whether I click 'Yes' or 'No', the next time I open the form, the Item_Open event is not called.

Any ideas why?

Thanks much.
 
S

Sue Mosher [MVP-Outlook]

Sounds like your form is getting one-offed, which means it won't run code.
See http://www.slipstick.com/dev/formpub.htm#oneoff
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Alan said:
I have a custom contact form that I populate upon the Item_Open event.
However, this event is not getting called every time the form is loaded.
For example, if I make a change to the form, then close the form using the
'X' in the top right corner, I get a message box asking if I want to save
the changes made. Whether I click 'Yes' or 'No', the next time I open the
form, the Item_Open event is not called.
 
G

Guest

Sue, I think you were right...I am creating a one-off form that is then not running correctly.
What I am doing is dynamically adding some controls to a form after it is opened. When that form is saved, I think a one-off form is created. Is there a way I can work around this? I need to be able to save the data changes to the form, but I do not want to save the controls that are dynamically added to the form. Is there a way to distinguish between them? Any thoughts on how I can work around this

Thanks

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

Sounds like your form is getting one-offed, which means it won't run code
See http://www.slipstick.com/dev/formpub.htm#oneof
--
Sue Mosher, Outlook MV
Author o
Microsoft Outlook Programming - Jumpstart fo
Administrators, Power Users, and Developer
http://www.outlookcode.com/jumpstart.asp


Alan said:
I have a custom contact form that I populate upon the Item_Open event
However, this event is not getting called every time the form is loaded
For example, if I make a change to the form, then close the form using th
'X' in the top right corner, I get a message box asking if I want to sav
the changes made. Whether I click 'Yes' or 'No', the next time I open th
form, the Item_Open event is not called
 
S

Sue Mosher [MVP-Outlook]

You could try resetting the MessageClass property before saving the item:

Dim strClass

Function Item_Open()
strClass = Item.MessageClass
End Function

Function Item_Write
Item.MessageClass = strClass
End Function
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers




Alan said:
Sue, I think you were right...I am creating a one-off form that is then not running correctly.
What I am doing is dynamically adding some controls to a form after it is
opened. When that form is saved, I think a one-off form is created. Is
there a way I can work around this? I need to be able to save the data
changes to the form, but I do not want to save the controls that are
dynamically added to the form. Is there a way to distinguish between them?
Any thoughts on how I can work around this?
Thanks.

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

Sounds like your form is getting one-offed, which means it won't run code.
See http://www.slipstick.com/dev/formpub.htm#oneoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top