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 / Excel / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Outlook 11 > Outlook 10 Object Library Compatibility Issues

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Mac - 17 Jun 2004 10:20 GMT
Hi All,

I'm having a porblem with a workbook that uses the Outlook Object Library (MSOUTL.olb). In particular, the wb has references to the Version 10 file. Now that a new computer on the network has Version 11, it is causing a few incompatibility issues.

In particular, when the workbook, is saved on the machine that is sporting OL2003 it saves the references to OLB version 11. When a user on version 10 opens the file, the reference is missing, as "C:\Program Files\Microsoft Office\Office11\MSOUTL.olb" does not exist only "..Office10\MSOUTL.olb"

I've never had this sort of problem with version changes from 2000-2, so what is the cause.

Will copying the library onto the local machine resolve the issue or is this not advisable.

Your advice on this one is greatly appreciated.

Paul Mac.
Bob Phillips - 17 Jun 2004 12:42 GMT
Paul,

Try using late binding.

Instead of a declaration like

Dim olApp as Outlook.Application

use

Dim olApp As Object

all other Outlook objects should be defined as  Objects as well

and instantiate it like this

   Set olApp = CreateObject("Outlook.Application")

rather than

   Set olApp = New Outlook.Application

You will need to use values rather than Outlook constants as well.

There is a web page describing this at
xldynamic.com/source/xld_Early_Late.html

Signature

HTH

Bob Phillips
   ... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

> Hi All,
>
> I'm having a porblem with a workbook that uses the Outlook Object Library (MSOUTL.olb). In particular, the wb has references to the Version 10 file.
Now that a new computer on the network has Version 11, it is causing a few
incompatibility issues.

> In particular, when the workbook, is saved on the machine that is sporting OL2003 it saves the references to OLB version 11. When a user on version 10
opens the file, the reference is missing, as "C:\Program Files\Microsoft
Office\Office11\MSOUTL.olb" does not exist only "..Office10\MSOUTL.olb"

> I've never had this sort of problem with version changes from 2000-2, so what is the cause.
>
[quoted text clipped - 3 lines]
>
> Paul Mac.
Paul Mac - 17 Jun 2004 13:24 GMT
Great Thanks for that Bob.

I assume that this would then remove the necessity of a Reference to the specific Outlook Library?

P.

> Paul,
>
[quoted text clipped - 44 lines]
> >
> > Paul Mac.
Bob Phillips - 17 Jun 2004 13:38 GMT
As you rightly deduce, you should remove the reference.

As the web page says, if you develop early, that is on your machine, you
would set the defence at the start, before release you remove the reference.
If you maintain the reference, even using late binding techniques will
probably give you the problem.

Signature

HTH

Bob Phillips
   ... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

> Great Thanks for that Bob.
>
[quoted text clipped - 50 lines]
> > >
> > > Paul Mac.
Paul Mac - 17 Jun 2004 13:57 GMT
BTW that is a great reference site, xldynamic.com... I'll add that one to my Fav's

Cheers, Paul.

> As you rightly deduce, you should remove the reference.
>
[quoted text clipped - 65 lines]
> > > >
> > > > Paul Mac.
Bob Phillips - 17 Jun 2004 17:00 GMT
It is just in it's infancy, lots more work needed yet.

Signature

HTH

Bob Phillips
   ... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

> BTW that is a great reference site, xldynamic.com... I'll add that one to my Fav's
>
[quoted text clipped - 69 lines]
> > > > >
> > > > > Paul Mac.
Paul Mac - 17 Jun 2004 13:48 GMT
Thanks Bob,

Just answered my own question, by replacing all instances of Outlook.Application with the late bind, it removed the reference.

Will adding the Office11 version of the Outlook Library to a new directory (..\Office11\MSOUTL.olb) cause any conflicts with the Version 10 file?

It's just as a temporary measure as I go through all of the code and update it.

Thanks again,

Paul.

> Paul,
>
[quoted text clipped - 44 lines]
> >
> > Paul Mac.
Bob Phillips - 17 Jun 2004 17:05 GMT
Not sure with Outlook Paul, as I have never done it myself, but I would
suspect it would be okay. I have installed XL97, 2000 and XP on one machine
with no problems.

Signature

HTH

Bob Phillips
   ... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

> Thanks Bob,
>
[quoted text clipped - 56 lines]
> > >
> > > Paul Mac.
Tom Ogilvy - 17 Jun 2004 17:28 GMT
http://support.microsoft.com/default.aspx?scid=kb;en-us;826494&Product=out
Outlook 2003 and Outlook 2002 may crash after you install Office XP on a
computer that has Office 2003 installed

Seems to indicate this will be problematic.  It says:

Important Microsoft does not support running multiple versions of Outlook on
a single computer at the same time.

the last part, "at the same time" is ambiguous.  Does it mean trying to have
both executing or does it mean installed on the same computer and used
interchangeable so to speak.

This article about multiple versions of Office seems clearer:

http://support.microsoft.com/default.aspx?scid=kb;en-us;828956&Product=ofw
Running Multiple Versions of Microsoft Office with Office 2003

> Microsoft Office Outlook 2003 cannot coexist with any earlier version of
Microsoft Outlook. If you choose to install Office Outlook 2003, the Setup
program will not allow you to keep any earlier version.

Signature

Regards,
Tom Ogilvy

> Thanks Bob,
>
[quoted text clipped - 56 lines]
> > >
> > > Paul Mac.
Paul Mac - 17 Jun 2004 23:43 GMT
Thanks for the additional information Tom,

My interpertation of the KB article is that having the MSOUTL.olb file in the ..\Office11 folder should not interfere with the Office10 components.

I'll test and post back.

Regards,

Paul Mac.

> http://support.microsoft.com/default.aspx?scid=kb;en-us;826494&Product=out
> Outlook 2003 and Outlook 2002 may crash after you install Office XP on a
[quoted text clipped - 88 lines]
> > > >
> > > > Paul Mac.
DW - 18 May 2006 05:17 GMT
Thanks for your post ... this should resolve a similar problem that I am
having ...

I've put the following Function together:

Sub TestSendEmailLateBinding()
 Dim bResult As Boolean
 Dim arto(1) As String
 Dim arcc(1) As String
 Dim sto As String
 Dim sCC As String
 
 
 arto(0) = "fred@xxx.xyz.com"
 arto(1) = "george@xxx.xyz.com"
 arcc(0) = "jane@xxx.xyz.com"
 arcc(1) = "jill@xxx.xyz.com"
 bResult = SendEmailLateBinding("c:\output.log", arto, "Subject test",
"body test", arcc)
 
 
 sto = "fred@xxx.xyz.com"
 sCC = "george@xxx.xyz.com"
 bResult = SendEmailLateBinding("c:\output.log", sto, "Subject test", "body
test", sCC)
 

End Sub

Function SendEmailLateBinding(sInPathFile As String, sInTo As Variant, _
   sInSubject As String, sInBody As String, Optional sInCC As Variant) As
Boolean
 Dim bResult As Boolean
 Dim sResp As String
 Dim obApp As Object
 Dim obEmail As Object     'Outlook.MailItem
 Dim obFiles As Object     'Outlook.Attachments
 Dim obRecipients As Object 'Outlook.Recipients
 Dim obRecipient As Object   'Outlook.Recipient
 Dim iTo As Integer
 Dim iCC As Integer
 Dim bCont As Boolean
 
 Set obApp = CreateObject("Outlook.Application")
 Set obEmail = obApp.CreateItem(0)   '0=olMailItem
 Set obRecipients = obEmail.Recipients

 On Error Resume Next
   iTo = UBound(sInTo)
   
   If Err <> 0 Then
     Set obRecipient = obEmail.Recipients.Add(sInTo)
     Err.Clear
   Else
     For iTo = 0 To UBound(sInTo)
       Set obRecipient = obEmail.Recipients.Add(sInTo(iTo))
     Next iTo
   End If
   obRecipient.Type = 1   '1=to; 2=cc
   bCont = True

   iCC = UBound(sInCC)
   
   If Err <> 0 Then
     Set obRecipient = obEmail.Recipients.Add(sInCC)
     Err.Clear
   Else
     For iCC = 0 To UBound(sInCC)
       Set obRecipient = obEmail.Recipients.Add(sInTo(iCC))
     Next iCC
   End If
   obRecipient.Type = 2   '1=to; 2=cc
   bCont = True
 On Error GoTo 0
 
 
 If bCont Then
   obEmail.Subject = sInSubject
   obEmail.Body = sInBody
   
   If sInPathFile <> "" Then
     obEmail.Attachments.Add sInPathFile, 1    '1=olByValue
   End If
   
   'send email
   On Error Resume Next
     obEmail.Send
     
     If Err > 0 Then
       sResp = MsgBox("Email to " & sInTo & " has not been sent." & _
           Chr(10) & "Err: " & Err.Description & _
           Chr(10) & "Do you want the program to continue?", vbYesNo)
       
       If sResp = 6 Then
         bResult = True
       Else
         bResult = False
       End If
       
       Err.Clear
     Else
       bResult = True
     End If
   On Error GoTo 0
 End If
 SendEmailLateBinding = bResult
End Function

> Paul,
>
[quoted text clipped - 44 lines]
> >
> > Paul Mac.
DW - 19 May 2006 04:27 GMT
And an improved version:

Function SendEmailLateBinding(sInPathFile As String, sInTo As Variant, _
   sInSubject As String, sInBody As String, Optional sInCC As Variant) As
Boolean
 Dim bResult As Boolean
 Dim sResp As String
 Dim obApp As Object
 Dim obEmail As Object     'Outlook.MailItem
 Dim obFiles As Object     'Outlook.Attachments
 Dim obRecipients As Object 'Outlook.Recipients
 Dim obRecipient As Object   'Outlook.Recipient
 Dim iTo As Integer
 Dim iCC As Integer
 Dim bCont As Boolean
 
 Set obApp = CreateObject("Outlook.Application")
 Set obEmail = obApp.CreateItem(0)   '0=olMailItem
 Set obRecipients = obEmail.Recipients

 On Error Resume Next
   iTo = UBound(sInTo)
   
   If Err <> 0 Then
     Set obRecipient = obEmail.Recipients.Add(sInTo)
     Err.Clear
   Else
     For iTo = 0 To UBound(sInTo)
       Set obRecipient = obEmail.Recipients.Add(sInTo(iTo))
     Next iTo
   End If
   obRecipient.Type = 1   '1=to; 2=cc
   bCont = True

   If Not IsMissing(sInCC) Then
     iCC = UBound(sInCC)
     
     If Err <> 0 Then
       Set obRecipient = obEmail.Recipients.Add(sInCC)
       Err.Clear
     Else
       For iCC = 0 To UBound(sInCC)
         Set obRecipient = obEmail.Recipients.Add(sInTo(iCC))
       Next iCC
     End If
     
     obRecipient.Type = 2   '1=to; 2=cc
     bCont = True
   End If
 On Error GoTo 0
 
 
 If bCont Then
   obEmail.Subject = sInSubject
   obEmail.Body = sInBody
   
   If sInPathFile <> "" Then
     obEmail.Attachments.Add sInPathFile, 1    '1=olByValue
   End If
   
   'send email
   On Error Resume Next
     obEmail.Send
     
     If Err > 0 Then
       sResp = MsgBox("Email to " & sInTo & " has not been sent." & _
           Chr(10) & "Err: " & Err.Description & _
           Chr(10) & "Do you want the program to continue?", vbYesNo)
       
       If sResp = 6 Then
         bResult = True
       Else
         bResult = False
       End If
       
       Err.Clear
     Else
       bResult = True
     End If
   On Error GoTo 0
 End If
 SendEmailLateBinding = bResult
End Function

> Thanks for your post ... this should resolve a similar problem that I am
> having ...
[quoted text clipped - 152 lines]
> > >
> > > Paul Mac.
 
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.