Where does my code belong?

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

Guest

This may be a very basic (and stupid) question, but I am confused as to where my code is supposed to be: in the ThisOutlookSession area or the 'View Code' editor when in design mode. I am assuming that if my code is form related (i.e. pre-populate a form), I would do this in 'View Code' editor.
What about if I wanted to have a function that several forms use? For example, if I always wanted to populate a user-field dropdown list that is used on several forms, I assume this code belongs in the 'ThisOutlookSession' area. Do I then call it from the 'View Code' editor code? How would this be done?
Obviously, my terms are probably off here. What is the correct term for the 'ThisOutlookSession' code and the 'View Code' editor code?
Thanks in advance for answering my 'dumb' questions. :)
 
If your code is to run behind an Outlook form, then you put it in the View Code editor available in Outlook form design mode. The code needs to be linked to item events or control Click events in the form.

While you can call subroutines in the ThisOutlookSession module from VBScript form code using the Application.mysubroutine syntax, this technique is officially unsupported.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Back
Top