-2147024770 Error mesasge

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
I wrote an access 2003 application that opens an Outlook(2003) email message
(when pressing a button).
On one computer, i get the above error.when trying to debug it, i get the
highlight on the first code line:
Set oOutlook = New Outlook.Application
Set oNameSpace = oOutlook.GetNamespace("MAPI")
Set oMailItem = oOutlook.CreateItem(olMailItem)
I have other computers and its working great.
Any thoughts??
Thanks in advance
 
It would seem that computer either doesn't have Outlook installed on it, or
it has the wrong version of Outlook installed on it. Next time you stop it
in Debug on that machine, select Tools | References from the menu and see if
any of the check marked references have the word MISSING in front of them.
If not, make sure the one that says Outlook x.x is the same version (11.0,
etc.) as it does on your machine.
 
Lp12 said:
I wrote an access 2003 application that opens an Outlook(2003) email message
(when pressing a button).
On one computer, i get the above error.when trying to debug it, i get the
highlight on the first code line:
Set oOutlook = New Outlook.Application
Set oNameSpace = oOutlook.GetNamespace("MAPI")
Set oMailItem = oOutlook.CreateItem(olMailItem)

To add to Ron's posting. The version of Outlook on that system is
likely an older version. I'd suggest you use Late Binding to ensure
your code is Outlook version independent.

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.

You'll want to install the reference if you are programming or
debugging and want to use the object intellisense while in the VBA
editor. Then,. once your app is running smoothly, remove the
reference and setup the late binding statements.

Sample code:
' Declare an object variable to hold the object
' reference. Dim as Object causes late binding.
Dim objWordDoc As Object
Set objWordDoc = CreateObject(" Word.Document")

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
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Thanks for the response but in the problematic computer, outlook 2003 is
installed and there are no missing references. I've updated the office SP2
but no luck.
Any suggestions?
Thanks again for the effort
 

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

Back
Top