Article ID: 238404 - Last Review: January 24, 2007 - Revision: 4.2 OL: How to Programmatically Determine the Version of OutlookThis article was previously published under Q238404 On This PageSUMMARY
There may be times when your Outlook solution needs to determine which version of Outlook is currently running so that your code can take appropriate action. This article describes an approach you can use to accomplish this.
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either
expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes
that you are familiar with the programming language being demonstrated and the
tools used to create and debug procedures. Microsoft support professionals can
help explain the functionality of a particular procedure, but they will not
modify these examples to provide added functionality or construct procedures to
meet your specific needs. If you have limited programming experience, you may
want to contact a Microsoft Certified Partner or the Microsoft fee-based
consulting line at (800) 936-5200. For more information about Microsoft Certified
Partners, please visit the following Microsoft Web site:
https://partner.microsoft.com/global/30000104
(https://partner.microsoft.com/global/30000104)
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
(http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms)
The Outlook 97 and Outlook 98 object models do not provide a direct way to determine the installed version of Outlook, but you can obtain the version of Outlook from the OutlookVersion property of an item. The OutlookVersion property contains the version of Outlook that created the item, and it is in the format of "nn.nn" (without quotation marks). The "nn.nn" format is the major and minor Outlook version numbers. If you programmatically create a temporary item, you can retrieve the version of Outlook that created the item. This version is the current version of Outlook that is installed. The advantage of using this approach is that it works with all versions of Outlook, but the disadvantage is that you cannot retrieve the actual build number. Starting with Outlook 2000, the Application object has a Version property that returns the full version number of Outlook, including the build number, in a format of "nn.nn.nnnn.nnnn" (without quotation marks). If your solution must work with Outlook 2000 and later, this Version property is probably the best approach to use. The example in this article describers how to use an item's OutlookVersion property because this approach works in all versions of Outlook, and it is more difficult to implement. To Use the OutlookVersion PropertyThe approach below creates a temporary Outlook item and obtains the version number using the OutlookVersion property. Then the temporary item is deleted. One advantage of using this approach is that it will work in situations where any version of Outlook may be installed on the system.REFERENCES
For additional information about available resources and answers to commonly asked questions about Microsoft Outlook solutions, click the following article numbers to view the articles in the Microsoft Knowledge Base:
287530
(http://support.microsoft.com/kb/287530/EN-US/
)
OL2002: Questions About Custom Forms and Outlook Solutions
146636
(http://support.microsoft.com/kb/146636/EN-US/
)
OL2000: Questions About Custom Forms and Outlook Solutions
182349
(http://support.microsoft.com/kb/182349/EN-US/
)
OL98: Questions About Custom Forms and Outlook Solutions
170783
(http://support.microsoft.com/kb/170783/EN-US/
)
OL97: Questions About Customizing or Programming Outlook
| Article Translations
|

Back to the top
