robyholmes
Registered User.
- Local time
- Today, 20:30
- Joined
- Mar 2, 2009
- Messages
- 57
Outlook calendar delete all apointments
<Please see below as this thread has changed a bit>
Hi,
I found this VBA code for adding appointments to outlooks calendar. It asks for the start date, but I would like end date (Like in outlook) not duration. Is this possible or do I just convert it to duration.
Background:
It is to be used for a holiday cottages booking system (I have posted before for a subform add and update code, working on that now). But basicly my parents, want to view the bookings on a calendar, and outlook has a very nice interface. My dad also wants to use a blackberry to snyc with outlook and get the calendar so he can view it out and about.
We have 3 cottages, so we can have 3 bookings on the same day. I could use catorgorise or 3 seperate calendars (I don't know if blackberry can support more than 1)
Task:
So i was wanting to use this code to add them to the calendar. Does this code add them, so if it was run again it would add it again, not update one that is already in?
I am using access 2007 and outlook 2007. If you want the table sturture I can post it. I would like the code, but if you have a idea about how to do it, then post and we will see which is the best solution.
Thanks a lot
Rob Holmes
<Please see below as this thread has changed a bit>
Hi,
I found this VBA code for adding appointments to outlooks calendar. It asks for the start date, but I would like end date (Like in outlook) not duration. Is this possible or do I just convert it to duration.
Background:
It is to be used for a holiday cottages booking system (I have posted before for a subform add and update code, working on that now). But basicly my parents, want to view the bookings on a calendar, and outlook has a very nice interface. My dad also wants to use a blackberry to snyc with outlook and get the calendar so he can view it out and about.
We have 3 cottages, so we can have 3 bookings on the same day. I could use catorgorise or 3 seperate calendars (I don't know if blackberry can support more than 1)
Task:
So i was wanting to use this code to add them to the calendar. Does this code add them, so if it was run again it would add it again, not update one that is already in?
I am using access 2007 and outlook 2007. If you want the table sturture I can post it. I would like the code, but if you have a idea about how to do it, then post and we will see which is the best solution.
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
Rob Holmes
Last edited: