Access to Outlook Calendar for Alert or Alarm Message Reminders (1 Viewer)

georget

Registered User.
Local time
Today, 06:57
Joined
Jul 17, 2002
Messages
31
I'm using MS XP. Can a Date I enter into my Access db automatically be sent to MS Outlook Calendar so I receive a pop-up message reminding me of the appointment? If so, how? thanks!
 

georget

Registered User.
Local time
Today, 06:57
Joined
Jul 17, 2002
Messages
31
Outllook Calendar

I figured it out. It's awesome. I can now enter a Subject, Date and Time and with one press of the button, it adds an appointment to Outlook a a Pop up message appears to remind me of the appointment!
 

Fizzio

Chief Torturer
Local time
Today, 11:57
Joined
Feb 21, 2002
Messages
1,885
Spill the beans for us all to learn from then. I've been wondering how to do this myself!:confused:
 

georget

Registered User.
Local time
Today, 06:57
Joined
Jul 17, 2002
Messages
31
Here's an example to create a form to add an appointment to Outlook. Of course the names can be changed and other fields can be added.

Create the following table (name it tblAppointments)

Field Name: Appt
Data Type: Text
Field Size: 50
Required: Yes
Field Name: ApptDate
Data Type: Date/Time
Format: Short Date
Required: Yes
Field Name: ApptTime
Data Type: Date/Time
Format: Medium Time
Required: Yes
Field Name: ApptLength
Data Type: Number
Field Size: Long Integer
Default Value: 15
Required: Yes
Field Name: ApptNotes
Data Type: Memo
Field Name: ApptLocation
Data Type: Text
Field Size: 50
Field Name: ApptReminder
Data Type: Yes/No
Field Name: ReminderMinutes
Data Type: Number
Field Size: Long Integer
Default Value: 15
Field Name: AddedToOutlook
Data Type: Yes/No


PrimaryKey: ApptDate;ApptTime
NOTE: In this example, the primary key in the appointment table is the appointment date and time. You can remove or alter the primary key if you want to be able to add multiple appointments for the same date and time.
Create a reference to the Microsoft Outlook Object Library. To do so, follow these steps:
Create a new module.
On the Tools menu, click References.
Click Microsoft Outlook Object Library in the Available References box.
Click OK in the Reference dialog box.
Close the module without saving it.

Use the AutoForm: Columnar Form Wizard to create a new form based on the tblAppointments table. Save the form as frmAppointments.
Open the form in Design view and change the following properties:
Form Name: frmAppointments
-------------------------
Caption: Appointment Form

Form Header:
Height: .5"
Check Box: AddedToOutlook
Enabled: No

Add a command button to the Form Header section, and set the following properties:
Command Button:
Name: AddAppt
Caption: Send to Outlook
OnClick: [Event Procedure]

Set the OnClick property of the command button to the following event procedure:

Private Sub AddAppt_Click()
' Save record first to be sure required fields are filled.
DoCmd.RunCommand acCmdSaveRecord
' Exit the procedure if appointment has been added to Outlook.
If Me!AddedToOutlook = True Then
MsgBox "This appointment already added to Microsoft Outlook"
Exit Sub
' Add a new appointment.
Else
Dim outobj As Outlook.Application
Dim outappt As Outlook.AppointmentItem
Set outobj = CreateObject("outlook.application")
Set outappt = outobj.CreateItem(olAppointmentItem)
With outappt
.Start = Me!ApptDate & " " & Me!ApptTime
.Duration = Me!ApptLength
.Subject = Me!Appt
If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes
If Not IsNull(Me!ApptLocation) Then .Location = _
Me!ApptLocation
If Me!ApptReminder Then
.ReminderMinutesBeforeStart = Me!ReminderMinutes
.ReminderSet = True
End If
.Save
End With
End If
' Release the Outlook object variable.
Set outobj = Nothing
' Set the AddedToOutlook flag, save the record, display a message.
Me!AddedToOutlook = True
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Appointment Added!"
Exit Sub
AddAppt_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
Exit Sub
End Sub

Save the form and open it in Form view. Add an appointment record, and then click the Send To Outlook button. Be sure you only enter minutes, not hours and minutes, in the ApptLength field.

Start Microsoft Outlook and click Calendar on the Go menu to view the appointments you added.

The error message needs worked....cheers.
 

Fizzio

Chief Torturer
Local time
Today, 11:57
Joined
Feb 21, 2002
Messages
1,885
Cheers, I shall have fun with this!:D
 

BillH

New member
Local time
Today, 11:57
Joined
May 1, 2002
Messages
9
Set appointments for others???

Hi Georget,
This is very cool! I've been trying to figure out something like this for a while.
My question is if the code can be modified to create appointments for yourself and for co-workers.
Any thoughts?
Thanks again
 

Ceejay64

Bass Playin' Biker Chick
Local time
Today, 06:57
Joined
Oct 2, 2002
Messages
74
That works extra slick!
Thanks for sharing it!!
~Ceejay
 

locomotion

Registered User.
Local time
Today, 20:57
Joined
Dec 7, 2005
Messages
25
BillH said:
Hi Georget,
This is very cool! I've been trying to figure out something like this for a while.
My question is if the code can be modified to create appointments for yourself and for co-workers.
Any thoughts?
Thanks again
If you use microsoft exchange server you should be able to add the appropriate appointment into the other persons calendar
 

Darth Vodka

Registered User.
Local time
Today, 11:57
Joined
Sep 25, 2007
Messages
344
aha, this was just what i was looking for

have rewritten it slightly to bypass the form and take the recordset

Code:
'---------------------------------------------------------------------------------------
' Procedure : AppointmentsFromTable
' Author    : Darth Vodka
' Date      : 26/02/08
' Purpose   : to convert a table of appointments into outlook appointments
'---------------------------------------------------------------------------------------
'
Public Sub AppointmentsFromTable()
    Dim db              As DAO.Database
    Dim rs              As DAO.Recordset
    Dim OutObj          As Outlook.Application
    Dim OutAppt         As Outlook.AppointmentItem

    Set db = CurrentDb
    Set rs = db.OpenRecordset("tbl_Outlook_Appointments")
    
    Do Until rs.EOF
        If rs("AddedToOutlook") = False Then
            Set OutObj = CreateObject("outlook.application")
            Set OutAppt = OutObj.CreateItem(olAppointmentItem)
            With OutAppt
                .Start = rs("ApptTime")
                .Duration = rs("ApptLength")
                .Subject = rs("Appt")
                .Body = Nz(rs("ApptNotes"), "")
                .Location = Nz(rs("ApptLocation"), "")
                If rs("ApptReminder") Then
                    .ReminderMinutesBeforeStart = Nz(rs("ApptLocation"), 15)
                    .ReminderSet = True
                End If
                .Save
                rs.Edit
                rs("AddedToOutlook") = True
                rs.Update
            End With
            Set OutObj = Nothing
            Set OutAppt = Nothing
        End If
        rs.MoveNext
    Loop
    
    rs.Close
    Set db = Nothing
    Set rs = Nothing

End Sub

and i merged the date fields
 

lisaterl

New member
Local time
Today, 06:57
Joined
May 7, 2008
Messages
3
does anyone have code to add to have it save to a calendar on a public folder?
 

mnmhemaj

New member
Local time
Today, 03:57
Joined
May 22, 2008
Messages
4
Hi! How to use the access table data or a query result inside the body of the appointment?
 

lisaterl

New member
Local time
Today, 06:57
Joined
May 7, 2008
Messages
3
In a form when a person sets up an event, I would like a button that would send details to a public calendar in outlook.

Thanks
 

kimmy

New member
Local time
Today, 03:57
Joined
Jul 18, 2008
Messages
1
Hi,
This is really cool.! Is there a way to go the other way -- i.e., to make events entered directly in Outlook calendar show up as data in Access table?
kimmy
 

smuhajir2000

New member
Local time
Today, 16:27
Joined
Feb 17, 2009
Messages
1
thank you man,
it will work correctly, now i want to, how to generate an alarm in access on a particular date like birthday etc....? if u know pl give me the code for generate the alarm;) thank u once again

Here's an example to create a form to add an appointment to Outlook. Of course the names can be changed and other fields can be added.

Create the following table (name it tblAppointments)

Field Name: Appt
Data Type: Text
Field Size: 50
Required: Yes
Field Name: ApptDate
Data Type: Date/Time
Format: Short Date
Required: Yes
Field Name: ApptTime
Data Type: Date/Time
Format: Medium Time
Required: Yes
Field Name: ApptLength
Data Type: Number
Field Size: Long Integer
Default Value: 15
Required: Yes
Field Name: ApptNotes
Data Type: Memo
Field Name: ApptLocation
Data Type: Text
Field Size: 50
Field Name: ApptReminder
Data Type: Yes/No
Field Name: ReminderMinutes
Data Type: Number
Field Size: Long Integer
Default Value: 15
Field Name: AddedToOutlook
Data Type: Yes/No


PrimaryKey: ApptDate;ApptTime
NOTE: In this example, the primary key in the appointment table is the appointment date and time. You can remove or alter the primary key if you want to be able to add multiple appointments for the same date and time.
Create a reference to the Microsoft Outlook Object Library. To do so, follow these steps:
Create a new module.
On the Tools menu, click References.
Click Microsoft Outlook Object Library in the Available References box.
Click OK in the Reference dialog box.
Close the module without saving it.

Use the AutoForm: Columnar Form Wizard to create a new form based on the tblAppointments table. Save the form as frmAppointments.
Open the form in Design view and change the following properties:
Form Name: frmAppointments
-------------------------
Caption: Appointment Form

Form Header:
Height: .5"
Check Box: AddedToOutlook
Enabled: No

Add a command button to the Form Header section, and set the following properties:
Command Button:
Name: AddAppt
Caption: Send to Outlook
OnClick: [Event Procedure]

Set the OnClick property of the command button to the following event procedure:

Private Sub AddAppt_Click()
' Save record first to be sure required fields are filled.
DoCmd.RunCommand acCmdSaveRecord
' Exit the procedure if appointment has been added to Outlook.
If Me!AddedToOutlook = True Then
MsgBox "This appointment already added to Microsoft Outlook"
Exit Sub
' Add a new appointment.
Else
Dim outobj As Outlook.Application
Dim outappt As Outlook.AppointmentItem
Set outobj = CreateObject("outlook.application")
Set outappt = outobj.CreateItem(olAppointmentItem)
With outappt
.Start = Me!ApptDate & " " & Me!ApptTime
.Duration = Me!ApptLength
.Subject = Me!Appt
If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes
If Not IsNull(Me!ApptLocation) Then .Location = _
Me!ApptLocation
If Me!ApptReminder Then
.ReminderMinutesBeforeStart = Me!ReminderMinutes
.ReminderSet = True
End If
.Save
End With
End If
' Release the Outlook object variable.
Set outobj = Nothing
' Set the AddedToOutlook flag, save the record, display a message.
Me!AddedToOutlook = True
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Appointment Added!"
Exit Sub
AddAppt_Err:
MsgBox "Error " & Err.Number & vbCrLf & Err.Description
Exit Sub
End Sub

Save the form and open it in Form view. Add an appointment record, and then click the Send To Outlook button. Be sure you only enter minutes, not hours and minutes, in the ApptLength field.

Start Microsoft Outlook and click Calendar on the Go menu to view the appointments you added.

The error message needs worked....cheers.
 

flect

Registered User.
Local time
Today, 20:57
Joined
Feb 26, 2008
Messages
86
wow! fantastic stuff!

I too would be interested to know if you can send these appointments to other outlook recipients, or even just email addresses.

great work though!!!
 

pl512pl512

New member
Local time
Today, 06:57
Joined
Jul 28, 2009
Messages
1
This is the code to setup an other user appointment with exchange :

Function CreateOtherUserAppointment()
Dim strMsg As String
Dim strName As String
On Error Resume Next

' ### name of person whose Calendar you want to use ###
strName = "s.bouchard"

Set objApp = CreateObject("Outlook.Application")
Set objNS = objApp.GetNamespace("MAPI")
Set objDummy = objApp.CreateItem(olMailItem)
Set objRecip = objDummy.Recipients.Add(strName)
objRecip.Resolve
If objRecip.Resolved Then
On Error Resume Next
Set objFolder = objNS.GetSharedDefaultFolder(objRecip, 9)
If Not objFolder Is Nothing Then
Set objAppt = objFolder.Items.Add
If Not objAppt Is Nothing Then
With objAppt
.Subject = "Test Appointment"
.start = #6/30/2009 3:00:00 PM# 'MM/JJ/AAAA
.duration = 120
.Location = "quelque part"
.Save
End With
End If
End If
Else
MsgBox "Could not find " & Chr(34) & strName & Chr(34), , _
"User not found"
End If

Set objApp = Nothing
Set objNS = Nothing
Set objFolder = Nothing
Set objDummy = Nothing
Set objRecip = Nothing
Set objAppt = Nothing

End Function
 

gera24

New member
Local time
Today, 03:57
Joined
Jan 27, 2010
Messages
6
Guys, i tried doing this, but did not work. The screen saying: This Appointment already added to MIcrosoft Outlook, pop ups, but i got to my outlook and is not there.
I am using outlook 2007 and i tried in a computer using outlook 2003 but still did not work.

PLEASE PLEASE HELP! I WOULD REALLY LIKE TO HAVE THIS INCREDIBLE OPTION!

I am not a computer savy, actually i build a network database myself just learning from things over the internet. It works excellent in my business, but i would like to have this option. I liked what you guys did here, because you gave a step by step process so anyone (with little knowledge) could build the reminder option.

THANK YOU AND PLEASE HELP.
 

gera24

New member
Local time
Today, 03:57
Joined
Jan 27, 2010
Messages
6
Guys, i tried doing this, but did not work. The screen saying: This Appointment already added to MIcrosoft Outlook, pop ups, but i got to my outlook and is not there.
I am using outlook 2007 and i tried in a computer using outlook 2003 but still did not work.

PLEASE PLEASE HELP! I WOULD REALLY LIKE TO HAVE THIS INCREDIBLE OPTION!

I am not a computer savy, actually i build a network database myself just learning from things over the internet. It works excellent in my business, but i would like to have this option. I liked what you guys did here, because you gave a step by step process so anyone (with little knowledge) could build the reminder option.

THANK YOU AND PLEASE HELP.
 

AlienRay

Registered User.
Local time
Today, 06:57
Joined
Oct 8, 2003
Messages
47
Very nice. Thanks for sharing this.

I have no use for this right now, but it's definitely nice to have it in the toolbox.
 

Users who are viewing this thread

Top Bottom