demo of Access invoking Outlook does not work

  • Thread starter Thread starter LarryD
  • Start date Start date
L

LarryD

I'm trying to use the demo as shown in the KB.
KB:318881

I'm in Access as I'm doing this


But when I compile it, it does not compile because
the 1st line creates an error that it does not know the
type.

Dim MyDB As Database
Dim MyRS As Recordset
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim TheAddress As String
....


Using the Tool/Reference is not happening because I don't
know what type lib's to include to get this reference.

Q1) What is the right type library?
Q2) Without calling for help, how would I figure this out
on my own?

Thanks

LarryD
 
LarryD said:
I'm trying to use the demo as shown in the KB.
KB:318881

I'm in Access as I'm doing this


But when I compile it, it does not compile because
the 1st line creates an error that it does not know the
type.

Dim MyDB As Database
Dim MyRS As Recordset
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
Dim TheAddress As String
...


Using the Tool/Reference is not happening because I don't
know what type lib's to include to get this reference.

Q1) What is the right type library?
Q2) Without calling for help, how would I figure this out
on my own?

That article is referring to Access 97, but from the fact that you're
getting an error on the "Dim MyDB As Database", I conclude that you're
using Access 2000 or later. That's because you need a reference to DAO,
and such a reference was included by default in Access 97, but not in
the later versions. Therefore I assume you need a reference to the
appropriate DAO library for Access 2000 or later:

Microsoft DAO 3.6 Object Library

You'll also need to modify the declarations of the DAO objects as
follows:

Dim MyDB As DAO.Database
Dim MyRS As DAO.Recordset

You'll also need to set a reference to the

Microsoft Outlook <version> Object Library

as directed at the bottom of the KB article. I don't know which version
you want, because I don't know what version of Office you have
installed. I doubt it's 8.0, though -- that's what the article says,
but the article was written for Access 97. You probably want 9.0
(Outlook 2000) or 10.0 (Outlook 2002).

As for how to figure it out on your own, the dropping of the default DAO
reference with Access 2000 has caused no end of questions to the
newsgroups. Probably your best bet would have been a search at Google
Groups ( http://groups.google.com ) for messages in groups "*.*access.*"
with the keywords "Database Undefined Type". I imagine a high
percentage of the hits you'd get would be concerning this issue.
 
Back
Top