![]() |
Outlook 11 Outlook 10 Object Library Compatibility Issues
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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
Great Thanks for that Bob.
I assume that this would then remove the necessity of a Reference to the specific Outlook Library? P. "Bob Phillips" wrote: 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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
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. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... Great Thanks for that Bob. I assume that this would then remove the necessity of a Reference to the specific Outlook Library? P. "Bob Phillips" wrote: 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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
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. "Bob Phillips" wrote: 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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
BTW that is a great reference site, xldynamic.com... I'll add that one to my Fav's
Cheers, Paul. "Bob Phillips" wrote: 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. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... Great Thanks for that Bob. I assume that this would then remove the necessity of a Reference to the specific Outlook Library? P. "Bob Phillips" wrote: 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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
It is just in it's infancy, lots more work needed yet.
-- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... BTW that is a great reference site, xldynamic.com... I'll add that one to my Fav's Cheers, Paul. "Bob Phillips" wrote: 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. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... Great Thanks for that Bob. I assume that this would then remove the necessity of a Reference to the specific Outlook Library? P. "Bob Phillips" wrote: 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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
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. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. "Bob Phillips" wrote: 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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
http://support.microsoft.com/default...94&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...56&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. -- Regards, Tom Ogilvy "Paul Mac" wrote in message ... 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. "Bob Phillips" wrote: 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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
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. "Tom Ogilvy" wrote: http://support.microsoft.com/default...94&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...56&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. -- Regards, Tom Ogilvy "Paul Mac" wrote in message ... 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. "Bob Phillips" wrote: 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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
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) = " arto(1) = " arcc(0) = " arcc(1) = " bResult = SendEmailLateBinding("c:\output.log", arto, "Subject test", "body test", arcc) sto = " sCC = " 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 "Bob Phillips" wrote: 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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
Outlook 11 Outlook 10 Object Library Compatibility Issues
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 "DW" wrote: 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) = " arto(1) = " arcc(0) = " arcc(1) = " bResult = SendEmailLateBinding("c:\output.log", arto, "Subject test", "body test", arcc) sto = " sCC = " 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 "Bob Phillips" wrote: 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 -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Paul Mac" wrote in message ... 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. |
All times are GMT +1. The time now is 04:32 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com