Alan,
If everyone in the office is using Office 2003 then it will be far easier to just update the references to the OFFICE 11.0 libraries and release a new version of the file. This means you wan't have to recode.
If you want to implement late binding then the best way to demonstrate how to do it is with a quick example. The basic rules here are: remove all the references to the external libraries, rewrite the declarations of all external library generated objects to declare them as Object, rewrite the initial object creation lines from
Code:
Set MyObj = New ExtLib.NewObj
to
Code:
Set MyObj = CreateObject("ExtLib.NewObj")
& get rid of any user-friendly constants and replace them with the underlying numbers.
The following bit of code demonstrates two subroutines which demonstrate Early and Late binding to open Outlook from Excel and create a new message. I've written this on the fly and not debugged so it comes with a health warning but it should be close enough.
Code:
Sub EarlyBinding(msgTo As String, msgSubj As String, msgBody As String)
Dim objOutlook As Outlook.Application
Dim objExplorer As Outlook.Explorer
Dim objNs As Outlook.Namespace
Dim objMsg As Outlook.MailItem
Set objOutlook = New Outlook.Application
Set objExplorer = OlApp.ActiveExplorer
If TypeName(objExplorer) = "Nothing" Then
Set objNs = OlApp.GetNamespace("MAPI")
objNs.Logon
End If
Set objMsg = objOutlook.CreateItem(olMailItem)
objMsg.to = msgTo
objMsg.Subject = msgSubj
If Len(msgBdy) > 0 Then
If HTMLFmt = False Then
objMsg.body = msgBdy
Else
objMsg.HTMLBody = msgBdy
End If
End If
End Sub
Sub LateBinding(msgTo As String, msgSubj As String, msgBody As String)
Dim objOutlook As Object
Dim objExplorer As Object
Dim objNs As Object
Dim objMsg As Object
Set objOutlook = CreateObject("Outlook.application")
Set objExplorer = OlApp.ActiveExplorer
If TypeName(objExplorer) = "Nothing" Then
Set objNs = OlApp.GetNamespace("MAPI")
objNs.Logon
End If
Set objMsg = objOutlook.CreateItem(0) 'Const olMailItem = 0
objMsg.to = msgTo
objMsg.Subject = msgSubj
If Len(msgBdy) > 0 Then
If HTMLFmt = False Then
objMsg.body = msgBdy
Else
objMsg.HTMLBody = msgBdy
End If
End If
End Sub
Hope this helps,
Maccas