dbTalk Databases Forums  

Outlook Reference Problem

comp.databases.ms-access comp.databases.ms-access


Discuss Outlook Reference Problem in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RLN
 
Posts: n/a

Default Outlook Reference Problem - 05-22-2009 , 09:35 AM






Re: Access 2003 / Outlook 2007

I have Access 2003/Outlook 2007 on my development PC.
My customers have Access 2003/Outlook 2003 on their PC.

When they run the part of the app that uses the Outlook object, they
get a "cannot find object or project library" error. (I think) This
is because I have Outlook 2007 installed, the app was compiled with
these objects and the user does not have Outlook 2007.

I launched the Access app and went into Tools/References and saw the
error on the customers' PC.

Is there a way via code to tell "Tools/References" to use an Outlook
2003 object in the app even though Outlook 2007 is installed on my
development PC?

Thanks.



Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: Outlook Reference Problem - 05-22-2009 , 10:11 AM






RLN wrote:

Quote:
Re: Access 2003 / Outlook 2007

I have Access 2003/Outlook 2007 on my development PC.
My customers have Access 2003/Outlook 2003 on their PC.

When they run the part of the app that uses the Outlook object, they
get a "cannot find object or project library" error. (I think) This
is because I have Outlook 2007 installed, the app was compiled with
these objects and the user does not have Outlook 2007.

I launched the Access app and went into Tools/References and saw the
error on the customers' PC.

Is there a way via code to tell "Tools/References" to use an Outlook
2003 object in the app even though Outlook 2007 is installed on my
development PC?

Thanks.


See if the following code determines if Outlook is open.

'Example on call
Dim b As Boolean
b = IsOutlookOpen()

'function to see if Outlook is open
Public Function IsOutlookOpen() As Boolean
On Error GoTo 0
On Error Resume Next
Dim objOutlook As Object
'Create the Outlook session.
Set objOutlook = GetObject(, "Outlook.Application") 'get ref

'if Outlook is already running.
If Err.Number = 429 Then 'Error 429
'occurs if Outlook is NOT running.
Err.Clear
'Create a new instance of the Outlook application.
Set objOutlook = CreateObject("Outlook.Application")
If Err.Number = 429 Then
'Error 429 will occur if MS Outlook is not installed.
MsgBox Err.Number & " - " & Err.Description & _
vbNewLine & _vbNewLine & _
"MS Outlook is not installed on your computer", , _
_"IsOutlookOpen"
ElseIf Err.Number <> 0 Then
MsgBox "Please open MS Outlook first.", , "IsOutlookOpen"
Else
IsOutlookOpen = True
End If
Else
IsOutlookOpen = True
End If
Set objOutlook = Nothing
End Function


Reply With Quote
  #3  
Old   
Tony Toews [MVP]
 
Posts: n/a

Default Re: Outlook Reference Problem - 05-22-2009 , 03:13 PM



RLN <rlntemp-gng (AT) yahoo (DOT) com> wrote:

Quote:
When they run the part of the app that uses the Outlook object, they
get a "cannot find object or project library" error. (I think) This
is because I have Outlook 2007 installed, the app was compiled with
these objects and the user does not have Outlook 2007.
Correct.

Quote:
I launched the Access app and went into Tools/References and saw the
error on the customers' PC.

Is there a way via code to tell "Tools/References" to use an Outlook
2003 object in the app even though Outlook 2007 is installed on my
development PC?
Not quite. You remove the reference completely and use late binding.

Late binding means you can safely remove the reference and only have an error when
the app executes lines of code in question. Rather than erroring out while starting
up the app and not allowing the users in the app at all. Or when hitting a mid, left
or trim function call.

This also is very useful when you don't know version of the external application
will reside on the target system. Or if your organization is in the middle of moving
from one version to another.

For more information including additional text and some detailed links see the "Late
Binding in Microsoft Access" page at http://www.granite.ab.ca/access/latebinding.htm

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Granite Fleet Manager http://www.granitefleet.com/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.