LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Outlook - Different Versions

Hello Everyone!

I'm sending out a spreadsheet with some code which people
will run to email me back. Sometimes it crashes because
everyone out there has a different version of Outlook.

I've had a good look through the postings on here and
think it's because the reference files are different.
I've got a found function that will tell me what version
everyone out there is using. But I don't know what to do
then?

I think it's one of the posts but it's just too
complicated for me, I'm new to VB.

My code is below.

If anyone could help I'd be very grateful

Sxx

Sub SimpleSender()

CheckOLVersion

MsgBox CheckOLVersion

Dim objOutlook As New Outlook.Application
Dim objOutlookMsg As Outlook.MailItem


'Open Outlook
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg

.Display
.Recipients.Add "Sophie"
.subject = "Tester"
.Body = "Here I am"
'.Send

End With

Set objOutlook = Nothing


End Sub
Function CheckOLVersion() ' As String
Dim objOL ' As Outlook.Application
Dim strVersion ' As String
Dim arrVer
On Error Resume Next

Set objOL = CreateObject("Outlook.Application")
strVersion = objOL.Version
If Err Then
' Outlook 97
CheckOLVersion = "97"
Exit Function
End If

arrVer = Split(strVersion, ".")
Select Case CInt(arrVer(0))
Case 8 ' Outlook 98
CheckOLVersion = "98"
Case 9 ' Outlook 2000
CheckOLVersion = "2000"
Case 10 ' Outlook 2002
CheckOLVersion = "2002"
Case 11 ' Outlook 2003
CheckOLVersion = "2003"
End Select
Set objOL = Nothing
End Function


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
custimized outlook today in outlook 2007 Hal Excel Discussion (Misc queries) 2 June 20th 07 12:59 AM
excel open in outlook if outlook is running kirk Excel Discussion (Misc queries) 0 May 24th 06 06:42 PM
Outlook 11 Outlook 10 Object Library Compatibility Issues Paul Mac[_4_] Excel Programming 11 May 19th 06 04:27 AM
Please include fonts from previous versions ('98) in new versions JJBQ Excel Discussion (Misc queries) 3 October 8th 05 07:19 PM
Display mail application either in Outlook, or Outlook express [email protected] Excel Programming 0 April 13th 04 09:50 PM


All times are GMT +1. The time now is 10:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"