Thanks for the code, it's working marvellously, only issue i'm having is that when i move to the next record the Check Box stays ticked, therefore I can't add any more appointments after the first one. Sure it's something simple that i've missed, appreciate your help, Thanks. Ben
Hi, i have this working with access 07 and outlook 07. however when a user tries with access 00 and outlook 03 i get an error, 'activex component can't create object 429' trying to figure out if this is to do with late and early binding, tho i think in this example its early binding anyway?
Is there a method we could detect where the client is using Outlook or Exchange server. (or does the Exchange server version work with Outlook). Fantastic work guys
Could some one add more names of field like Start Time, end Time (both dates and times)
Also could some one help me so I can include fields on email address we can invite to the appointment or meeting.
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
that was excelent worked a treat and yes i would be interested in how add to someones else calander
I do however email reports etc to individuals
so no reason why a email with info could not be sent to another person
I set up a variable
dim mailstr as string
and add text to that for the body of the email as needed for eg
mailstr = "Appointment needed for " & Forms![myform]![Apptdate]& " " & Forms![myform]![Appttime] &" any other text you may wish to add"
the email address could be got from a form as in example below
then send a email with the following
DoCmd.SendObject acSendNoObject, , acFormatTXT, Forms![myform]![the Email address field], , , "Subject line text " , mailstr, True
This is such great information, thanks so much. I am having a problem though. I am running Access 2010 and Outlook 2010. When I create the appointment and click the Add To Outlook button it says that it has been added but when I open outlook it is not there. Not sure where to start with the troubleshooting. The Windows username is different then my Outlook username, could that be the problem?
Sorry, I answered my own question. Once I changed the Outlook username to the same as the Windows username it worked perfectly. Maybe this info will help someone else.
This is amazing. I have a calendar I use to show who is out of the office on leave. I have >100 employees, so, sometimes that is a long list. In order to make the list readable I only make appointments on this calendar that are "all day events".
Here is where your sample code adds the appointment information:
well ages ago i was in the same dilemma. The restriction yuo have for getting outlook to display the popup notification is that you actually need to have outlook open in order to see it. If outlook is closed, the notification wont display!!
To combat this, i made a small plugin that i now add to my apps. It is a form of the same size as the notification popup and it displays in the same screen position. It fades in, shows for a set amount of time and then fades out. If you move your mouse over it, it reappears. Basically it acts exactly like the outlook popup but its completely within Access.
it actually works by a timer looking for near appointments. when one appears, it gets the required data from the recordset and calls the function. When the function is called, it sets a reccurance value in case i need it to keep re-appearing. this is the 'True' value. If i changed it to False, it would not reccur.
I also put a form colour option in just in case. There is a range of 10 colours.
I posting this on another forum ages ago. i'll did it out and post it in the samples area of AWF if its of interest.
The tool is mde and you would need to reference it as the code is not accessible im afraid
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
in the code above it adds dates to the default calendar, but I have several different calendars and would like to know how to add data to specific calendars.
for instance one called "specialdates"
Hi,
I added the table and form and code as described initially in this thread and was able to successfully add ONE appointment. If I change any of the other details it tells me it has already added the appointment but it refers back to the original field. I didn't see that anyone else posted the same issue. Is there any advice on how to overcome? Also is their a link or place that shows all the Outlook criteria or call outs so that I can add different things like email recipient?
THanks in advance for your help.
Razzbarry