I ran into a similar problem last week, but in reverse: I
had an Office XP setup and users on an Office 2k platform
got the same error as your users. I was not using any
code routines new to Outlook XP. For some reason, Access
and VB will correct references to other libraries (either
backwards or forwards), but not with Outlook. I did not
realize that the problem existed going forward from 98/2k
to XP2000.
I first tried running at startup the following routine
that removes any Outlook library references then adds in
whatever version the computer has:
Public Sub testOLref()
Dim refItem As Reference
Dim fs
Dim thePath As String
Dim ref As Reference
Dim i As Integer
On Error Resume Next
For Each refItem In References
If refItem.IsBroken And refItem.Name = "outlook" Then
Application.References.Remove refItem
Set fs = Application.FileSearch
With fs
.LookIn = "C:\Program Files\Microsoft Office"
.SearchSubFolders = True
.FileName = "MSOUTL*.OLB"
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
thePath = .FoundFiles(i)
Set ref = References.AddFromFile(thePath)
Next i
Else
MsgBox "Could not find Outlook library reference."
End If
End With
End If
Next refItem
End Sub
For some reason I could not figure, Office 2k choked on
the refItem.name property. Also, some Office installs were
to folders other than "Microsoft Office". The best
solution that I could come up with was to manually
dereference all OL libraries before I sent the database to
anyone, and replace the above with:
Public Sub testOLref()
Dim fs
Dim ref As Reference
Dim thePath As String
Dim i As Integer
On Error Resume Next
DoCmd.Hourglass True
Set fs = Application.FileSearch
With fs
.LookIn = "C:\Program Files"
.SearchSubFolders = True
.FileName = "MSOUTL*.OLB"
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
thePath = .FoundFiles(i)
Set ref = References.AddFromFile(thePath)
Next i
Else
MsgBox "Could not find Outlook library reference."
End If
End With
DoCmd.Hourglass False
End Sub
I'd be interested in hearing your thoughts or solutions.
The solution above is only so-so. The first one would be
fine, if it worked. If you want to reply offline, you can
email me at scott3832[at]myway.com.
Hope this helps!
- Scott
-----Original Message-----
I have designed a database using Windows 98. In my VBA
code I used the reference library above. But when a user
on a Windows 2000 XP tries to use the button I get a
message MISSING: Microsoft Office 10.0 object library.
Anyone have a suggestion as to what I am doing wrong?
Denise
.