Sending a Reminder to Outlook from MS Access

mlr0911

Registered User.
Local time
Today, 15:14
Joined
Oct 27, 2006
Messages
155
I am trying to send an email reminder to outlook from a command button.

I found this code on the forums, but I am getting a "Method or Data member not found" error message.


Here is the code that I am using:
Code:
Dim objOutlook As Application
Dim objAppt As Object
Set objOutlook = GetObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(1) '1=olAppointmentItem
 
 With objAppt
.Start = Me.txtstartDate
.Subject = "Project Start Date is " & [txtStartDate] & "Project Due Date is " & [Project Due Date] & "You will be required to attend the October 25th meeting in Vermont."
.ReminderSet = True
.ReminderMinutesBeforeStart = 15
.Save

I am getting the error on this:

Code:
Set objAppt = objOutlook.CreateItem(1) '1=olAppointmentItem

Any help is appreciated.

Thanks
 
Check you have the libarary referenced : Its Outlook Object Library 11 (I think) - go into the code module; Tools/References and check the above.
 
Thanks Ted for the reply, I do have MS outlook 11.0 Object Library referenced. I should have stated that earlier.

Thanks
 
Look at the format I've used here. This works (I know it does because I have 100 or so users that use it). Note the differences in variable declaration. You should be able to figure out what's wrong in your code by looking at this code. It's not setting a reminder -- it's sending an email -- but that's easy enough to change.

Code:
    Dim OLApp As New Outlook.Application
    Dim OLMsg As Outlook.MailItem
    
    Set OLMsg = OLApp.CreateItem(olMailItem)
    With OLMsg
        .Recipients.Add "blah blah blah"
        .Subject = "Select Provider ACD: " & cboMarkets.Column(1) & " | " & _
            cboRequestType.Column(1) & " | PIN: " & txtEPDBPIN & " | " & Now
        .Attachments.Add strFileName
        .Send
    End With
    
    MsgBox "Emailing Complete", vbOKOnly + vbInformation, "Email Sent"
    
    Set OLApp = Nothing
    Set OLMsg = Nothing
 

Users who are viewing this thread

Back
Top Bottom