VB.NET and Outlook automation - Detect Outlook Version 
Author Message
 VB.NET and Outlook automation - Detect Outlook Version

I'm writing an application that will (in part) enter information into a
retrieve information from Microsoft Outlook.  The users of my application
will either have Outlook 2000 or Outlook XP.  I know what I'm doing though
Outlook automation will work on either version...  Since I have to
specifically reference a version of the Outlook object library and there's a
potential that the user will have either Outlook 2000 or Outlook XP and my
application can't know until it runs which is installed how is this handled?
Do I make a reference to both libraries and then determine which to use when
the app runs.  Or, do I have to make two separate versions of my
application -- one for Outlook 2000 or one for Outlook XP.

I figure this has to be a fairly common issue for anyone writing
applications make use of MS Office automation.  Just curious what the "best
practice" is in handling this situation...

Thanks in advance for any assistance you can provide.

TK Herman



Thu, 12 May 2005 21:08:04 GMT  
 VB.NET and Outlook automation - Detect Outlook Version
Open this key

HKEY_CLASSES_ROOT\Outlook.Application\CurVer

read the valuename

Its just that simple.


Quote:
> I'm writing an application that will (in part) enter information into a
> retrieve information from Microsoft Outlook.  The users of my application
> will either have Outlook 2000 or Outlook XP.  I know what I'm doing though
> Outlook automation will work on either version...  Since I have to
> specifically reference a version of the Outlook object library and there's
a
> potential that the user will have either Outlook 2000 or Outlook XP and my
> application can't know until it runs which is installed how is this
handled?
> Do I make a reference to both libraries and then determine which to use
when
> the app runs.  Or, do I have to make two separate versions of my
> application -- one for Outlook 2000 or one for Outlook XP.

> I figure this has to be a fairly common issue for anyone writing
> applications make use of MS Office automation.  Just curious what the
"best
> practice" is in handling this situation...

> Thanks in advance for any assistance you can provide.

> TK Herman



Thu, 12 May 2005 22:39:36 GMT  
 VB.NET and Outlook automation - Detect Outlook Version
Here is some sample code:

Dim o As object

Set o = CreateObject("outlook.application")

MsgBox o.Version

Luke

(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Fri, 13 May 2005 16:05:20 GMT  
 VB.NET and Outlook automation - Detect Outlook Version
In order to execute the code you've listed below I have to have a reference
to the Outlook object library.  So my ultimate question is how do I know
what reference to use (at design time) in my application when the user could
be using either Outlook 2000 or Outlook XP?  Do I make a reference to each
library in my application at design time and then figure out which version
they're using at runtime and act accordingly?

To give you an example, I recently installed the Franklin/Covey "add-in" for
Microsoft Outlook.  Their product works on either Outlook 2000 or Outlook
XP.  How are they creating one product that works for multiple versions of
Outlook when they have to reference and work with an object library that is
tied to a specific version of Outlook-- either Outlook 9 or Outlook 10?

Does this make sense?

Thanks for the post!!!

TK



Quote:
> Here is some sample code:

> Dim o As object

> Set o = CreateObject("outlook.application")

> MsgBox o.Version

> Luke

> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)



Fri, 13 May 2005 22:38:22 GMT  
 VB.NET and Outlook automation - Detect Outlook Version

In order to execute the code you've listed below I have to have a reference
to the Outlook object library.  So my ultimate question is how do I know
what reference to use (at design time) in my application when the user could
be using either Outlook 2000 or Outlook XP?  Do I make a reference to each
library in my application at design time and then figure out which version
they're using at runtime and act accordingly?

To give you an example, I recently installed the Franklin/Covey "add-in" for
Microsoft Outlook.  Their product works on either Outlook 2000 or Outlook
XP.  How are they creating one product that works for multiple versions of
Outlook when they have to reference and work with an object library that is
tied to a specific version of Outlook-- either Outlook 9 or Outlook 10?

Does this make sense?

Luke's example uses late binding (declaring As Object). No reference to the type library is
required.

However, if you are using early-binding then simply use the version independent prog ID (i.e.
Outlook.Application). It shouldn't matter which type library version you specify because they
resolve to the same class identifier. As long as both versions support the features you implement
there shouldn't be a problem.


Microsoft MVP (Visual Basic)



Fri, 13 May 2005 23:09:18 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Using VB to Detect Outlook Version

2. (Q) Detecting Outlook Versions

3. Outlook Object Model... Need Version of Outlook

4. Outlook Automation/VB - Help Me Gurus!

5. Sending Outlook mail per vb-automation after the braindead security patch

6. OutLook Automation using VB

7. Outlook Automation Through VB

8. Outlook Automation/VB - Help Me Gurus!

9. Outlook Express automation from VB?

10. Using Automation with Outlook & VB 6

11. Outlook Automation/VB - Help Me Gurus!

12. Outlook Automation with VB question

 

 
Powered by phpBB® Forum Software