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

Emanuel Spence

New member
Local time
Yesterday, 21:00
Joined
Jun 2, 2010
Messages
1
Hello

Love the code !

How could you make the send to outlook button select the dates, times and subject from the form itself ?

Rather than opening a Diary form ?

Many Thanks

Emanuel
 

Bench

New member
Local time
Yesterday, 21:00
Joined
Oct 23, 2010
Messages
2
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
 

Bench

New member
Local time
Yesterday, 21:00
Joined
Oct 23, 2010
Messages
2
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?

Any thoughts would be appreciated

Thanks
 

undertm

Registered User.
Local time
Today, 14:00
Joined
Jul 28, 2011
Messages
14
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.
 

Attachments

  • Outlook Link ver 2.zip
    39.7 KB · Views: 299
Last edited:

Chi1linVi1lain

Registered User.
Local time
Today, 00:00
Joined
Sep 22, 2011
Messages
11
I made one quick modification adding "StartTime" and "EndTime" fields to the form, Setting them as "Unbound"

Then for the [ApptLength] I pasted the following formula into the "Default Value"

"=DateDiff("n"[EndTime],[StartTime])"
This sets the [Apptlength] to automatically calculate the duration of the appointment in minutes
(Note the formatting of the value "n" for minutes)
{"m" formats/calculates in 'months' in the DateDiff function}

Johnathon
 

undertm

Registered User.
Local time
Today, 14:00
Joined
Jul 28, 2011
Messages
14
Hi Johnathan

Could you upload your finished db for the world to share, I will continue to upload as I dev as well.

Thanks Guys
 

Wet_Blanket

Registered User.
Local time
Today, 00:00
Joined
Dec 3, 2008
Messages
113
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

Really cool! Do you know how to run it to a public calendar?
 

tonyk

New member
Local time
Today, 05:00
Joined
Mar 22, 2012
Messages
6
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 works fine for me :)
 
Last edited:

wezhogan

Registered User.
Local time
Yesterday, 23:00
Joined
May 24, 2012
Messages
16
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?
 

wezhogan

Registered User.
Local time
Yesterday, 23:00
Joined
May 24, 2012
Messages
16
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.

Louise
 

NickS

New member
Local time
Yesterday, 21:00
Joined
May 7, 2012
Messages
9
Hey guys,

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:


.Subject = "Test Appointment"
.start = #6/30/2009 3:00:00 PM# 'MM/JJ/AAAA
.duration = 120

How can I enter an all day event rather than an appointment with a start time and duration?

Thanks again, this forum is fantastic!

Nick
 

NigelShaw

Registered User.
Local time
Today, 05:00
Joined
Jan 11, 2008
Messages
1,573
Hi,

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.

I call it like this-
Code:
Call OutlookNotify ("Header", "Subtext", "Strapline", duration, Blue, True)

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 :(



Cheers

Nigel
 

wchelly

Registered User.
Local time
Yesterday, 21:00
Joined
Mar 1, 2010
Messages
146
Has anybody written this to a public folder?
 

drb555

Registered User.
Local time
Today, 07:00
Joined
Jul 10, 2013
Messages
19
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
this works well but adds the appointments to the default calendar.
How could I add it automatically to a different calendar called
"Specialdates"
 

jfriesen13

New member
Local time
Yesterday, 23:00
Joined
Feb 15, 2013
Messages
4
^^ I was wondering the same thing, but I have a calendar named "Installation." Any help would be greatly appreciated - calendar code has been awesome!
 

drb555

Registered User.
Local time
Today, 07:00
Joined
Jul 10, 2013
Messages
19
I am not sure where your at or what you exactly need but let me know.

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"
 

Razzbarry

Registered User.
Local time
Yesterday, 22:00
Joined
Sep 28, 2018
Messages
28
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
 

NigelShaw

Registered User.
Local time
Today, 05:00
Joined
Jan 11, 2008
Messages
1,573
It's been a while now but.....

If the appointment exists you need to edit it, if it doesnt exist, you need to add it

You cannot add what already exists
You cannot edit what doesnt exist
Etc etc
 

Razzbarry

Registered User.
Local time
Yesterday, 22:00
Joined
Sep 28, 2018
Messages
28
Thanks for the quick reply. I need to create a new record and it worked.
Now I just need to figure out the email part.
Have a great day.
 

Users who are viewing this thread

Top Bottom