Add appointment to other user's Calendar (1 Viewer)

megatronixs

Registered User.
Local time
Today, 12:52
Joined
Aug 17, 2012
Messages
719
Hi all,

I'm trying to make the below code work to add a reminder for another user in outlook. I use the appointment part. I works really nice on my outlook, but does not work on others Microsoft outlook exchange.
Any clue where I go wrong?

Code:
Option Compare Database
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
Dim objNS As Outlook.NameSpace
Set outobj = CreateObject("outlook.application")
Set outappt = outobj.CreateItem(olAppointmentItem)
Set objNS = outobj.GetNamespace("MAPI")
With outappt
'.Recipients.Add (Me!AppAttendee)
        Set objFolder = _
          objNS.GetSharedDefaultFolder(.Recipients.Add(Me!AppAttendee), olFolderCalendar)
          
.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

Greetings.
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 06:52
Joined
Apr 27, 2015
Messages
6,331
I have had problems in the past with this as well and it usually boils down to security settings on the network.

At home I came send email, set appointments and assign tasks in OL until the cows come home. At work, all I can do is set it up...all the sending and saving has to be done in native OL.
 

megatronixs

Registered User.
Local time
Today, 12:52
Joined
Aug 17, 2012
Messages
719
Hi all,
At the end it is not needed to set the appointment in some one else calendar :)
Now I face a different problem. I needed to add a text box that would contain the minutes from the meeting. They wanted to have text formatting and I did set the text box to Memo and rich text format. This works nice, but I can't use rich text when creating the invitation and send it out. I added in a second form another text box, but formatted to plain text, connected it to the same field as in the table, but this one shows the text (rich text format) as it is in the table :-( is it not possible to convert this into plain text when creating the invitation? would save from going crazy.

Greetings.
 

megatronixs

Registered User.
Local time
Today, 12:52
Joined
Aug 17, 2012
Messages
719
Hi all,

Closing this one as I have partially solved, but still struggle with the past values as text. I will ask the question per separated.

Greetings.
 

Users who are viewing this thread

Top Bottom