Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2006

Tip: Looking for answers? Try searching our database.

I think I've got it

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Charlie - 12 Apr 2006 02:37 GMT
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
Charles Kenyon - 12 Apr 2006 06:55 GMT
Glad we helped. In the future, though, it is a good idea to post something
like this as a reply in the continuing thread.
Signature

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

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!

My criminal defense site: http://addbalance.com
--------- --------- --------- --------- --------- ---------
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.

> 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
[quoted text clipped - 20 lines]
> Thanks,
> ck
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.