Like Windows Script Host, Outlook executes all script-level
code--not just variable declarations--when a form is loaded. In this case,
script-level code corresponds closely to the Outlook form's Item_Open event
procedure, which is fired when the form is opened.
Although you can use the script level for executable statements,
in most cases it is preferable that you do not. Most Outlook form programming
is event-driven programming; you should use events, including the Item_Open
event, to handle variable initialization, and confine yourself to using
script-level code to declare public and private variables.