OL2000: Managing and Distributing Outlook VBA Projects

ID: Q229911


The information in this article applies to:
  • Microsoft Outlook 2000


SUMMARY

This article provides an overview of how Microsoft Outlook stores Microsoft Visual Basic for Applications code, and how you can manage multiple projects.


MORE INFORMATION

Unlike other Microsoft Office programs, Microsoft Outlook supports only one Visual Basic for Applications project at a time. The project, Project1, is available and associated with the program at all times. It is not possible to add another project in the Visual Basic Editor.

Project1 is stored on your hard disk as VbaProject.OTM in the following folder:

<Drive>:\Windows\Application Data\Microsoft\Outlook
NOTE: The location of the Application Data folder may vary depending on the configuration of user profiles in Windows. To locate the file, follow these steps:
  1. Click Start, point to Find, and then click Files or Folders.


  2. In the Named box, type *.OTM


  3. Select the appropriate drive or drives and then click Find Now.


Outlook does not provide a direct means to manage OTM files. If you want to begin a new Visual Basic for Applications project, you could theoretically export all of your existing modules and forms, but this is typically not a realistic approach. Instead, follow these steps:
  1. Quit Microsoft Outlook.


  2. Locate your VbaProject.OTM file as described earlier.


  3. Rename the file to something meaningful to you, such as VbaProject-testing.OTM


  4. Restart Microsoft Outlook.


Because Outlook is not able to find an existing project file, Visual Basic Editor starts with a new project. When you save changes to your project, Outlook creates a new VbaProject.OTM in the folder.

If you want to switch between projects, add one additional step to the previous steps:
  1. Quit Microsoft Outlook.


  2. Locate your VbaProject.OTM file.


  3. Rename the file to something meaningful to you, such as VbaProject-testing.OTM


  4. Rename the file you now want to use back to VbaProject.OTM.


  5. Restart Microsoft Outlook.


If you want to move a Visual Basic for Applications project from one computer to another, first determine where Outlook is storing the VbaProject.OTM files on each computer. Then, copy the OTM file from one computer to the other, making sure to place it in the proper folder. When you restart Outlook, it will find the VbaProject.OTM file and use it.

NOTE: If you are developing a solution that you intend to distribute to more than a few people, consider converting your Visual Basic for Applications code into an Outlook COM Add-in.

For additional information about creating COM Add-ins, please refer to the Microsoft Outlook 2000 Visual Basic Reference (Vbaoutl9.chm) or the Microsoft Office Developer 2000 documentation.


REFERENCES

For additional information about available resources and answers to commonly asked questions about Microsoft Outlook 2000 solutions, please see the following article in the Microsoft Knowledge Base:

Q146636 OL2000: Questions About Custom Forms and Outlook Solutions

Additional query words: OutSol OutSol2000 vbscript

Keywords : kbdta
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: May 13, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.