Working with User Forms In Outlook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a user form which is displayed anytime a user sends a new item. I've
been using .Show & .Hide without any issues, but I'm curious as to wether or
not I should be cognizant of .Load & .Unload and wether or not I should be
using them as well.

Also, which event is triggered when a use closes the user form using the
right corner X?
 
You only need to use Load and Unload if you have specific processes or
objects that you are calling or instantiating/killing during those events.
Generally, you put your initialization code in the UserForm_Initialize event
which is called by Load, and clean up during UserForm_Terminate. If you call
UserForm.Show, it will not call UserForm_Initialize if the form has
previously been loaded and not unloaded sine.

When the user clicks the X to close, the UserForm_Activate event is called
followed by UserForm_QueryClose and then UserForm_Terminate.
 
Back
Top