Auto Email (1 Viewer)

RichB

New member
Local time
Today, 10:54
Joined
May 15, 2001
Messages
96
Can someone please look at this and help me as it does not work? It stops right away at the "Dim olApp As Outlook.Application". It tells me "user-defined type not defined". I have searched the forums and could not find a solution.

Thanks,
RichB



Private Sub Command154_Click()
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application

'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)
With objMail
'Set body format to HTML
.To = "Forms!FrmPersonal!Email"
.BCC = Forms!FrmPersonal!rateremail & Forms!FrmPersonal!rrateremail
.Subject = "AUTO EMAIL REMINDER"
.BodyFormat = olFormatHTML
.HTMLBody = "<HTML><BODY>Blah, Blah, Blah</BODY></HTML>"
.Display
End With

End Sub
 

Teebird

Registered User.
Local time
Tomorrow, 04:24
Joined
Sep 3, 2006
Messages
60
It relates to the References - I found I had to have the Reference to Microsoft Outlook 10.0 Object Library ticked.

In your VB window - go to Tools, References, Browse for the Reference for Outlook and tick and close the References form.
 

RichB

New member
Local time
Today, 10:54
Joined
May 15, 2001
Messages
96
Yep, that's it. Thanks. I should have known that!!:eek:
 

Users who are viewing this thread

Top Bottom