Microsoft Outlook 9.0 object library

D

Denise

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
 
S

ScottE

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
 
T

TC

I'm surprised that your first approach (using IsBroken) would work at all.
When a library reference is missing, this often causes >all< VBA code to go
screwy, immediately, unless you write it in a very special way - which you
have not done. So, for my interest, has your first approach ever worked?
That is, there >was< a missing library reference, and your first approach
did fix it<, automatically, "behind the scenes", without any errors during
that fixing process?

Your second approach looks better, to me.

TC


ScottE said:
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
.
 
S

ScottE

Thanks for your thoughts. The first approaach never
worked, but I was only able to test it on one machine with
the Outlook 9 library. The Access/VB help file, I now
notice, states that referring to the name property of a
broken reference (isbroken = true) will cause an error.
Therefore, I think that if I delete any broken references
without checking the name, then set a reference to
whatever version of the OL library exists on the machine,
the code might work. Something like:

For Each refItem In References
If refItem.IsBroken Then _
Application.References.Remove refItem
next refItem

on error resume next 'to avoid error msg if trying
'to set a reference to a computer on which the
'OL library reference was not broken and therefore
'not removed

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

I'll try it and let you know if it works. The problem
with the second approach below would be if a user ran the
code on a computer with the OL 10 library (and the
reference was set to that library), then gave that copy of
the database to a user with the OL 9 library. Not all
that likely, but possible.

- Scott
-----Original Message-----
I'm surprised that your first approach (using IsBroken) would work at all.
When a library reference is missing, this often causes
all< VBA code to go
screwy, immediately, unless you write it in a very special way - which you
have not done. So, for my interest, has your first approach ever worked?
That is, there >was< a missing library reference, and your first approach
did fix it<, automatically, "behind the scenes", without
any errors during
that fixing process?

Your second approach looks better, to me.

TC


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
.


.
b
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top