How do I send an Email (using Outlook 2000) from Access 2000

D

DAVEF

Previously worked ok with Access 98 using following code (module):

Function AutomateOutlook(p_to As String, p_subject As String, p_body As
String)
Dim olApp As New Outlook.Application
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = p_to
.subject = p_subject
.body = p_body
.Send
End With...................................etc...

Problem now is that Access 2000 VBA does not recognise "New
Outlook.Application"
in the DIM statement, giving a compile error - User-defined type not defined.
Any Ideas?
 
A

Arvin Meyer

You need to set a reference to the version of Outlook that you are using to
make this code work. Go to any code window and choose Tools ... References,
uncheck the one marked "MISSING", then find the reference to the version of
Outlook you are using.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Top