I think I've got it

C

Charlie

Oh, I see. So then if I add this code at the beginning of my code I can
remove the reference to Oulook Library and it will create a reference to
which ever one the computer has?



Dim oOLK As Object
Dim OLKVersion As Long

On Error Resume Next
OLKVersion = 12 'looking ahead<g>
Do
Set oOLK = CreateObject("Outlook.Application." & CStr(OLKVersion))
If oOLK Is Nothing Then
OLKVersion = OLKVersion - 1
End If
Loop While oOLK Is Nothing And OLKVersion >= 9 'Outlook 2000
On Error Goto 0
If oOLK Is Nothing Then
MsgBox "Outlook unfavourable"
Else
MsgBox "Outlook " & Cstr(OLKVersion) & " launched."
End If


Thanks,
ck
 
C

Charles Kenyon

Glad we helped. In the future, though, it is a good idea to post something
like this as a reply in the continuing thread.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide




--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top