Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
The below code works, locally, and that would be great if all users were running the application on their personal computers, however, users are logging into a Remote Desktop to access the application, and therein lies the dilemma. The Outlook Reminder is saving to the Remote Desktop calendar, not the local user's calendar.

I'm wondering if it is possible to force the Outlook Reminder to .Save to their local machine instead of the Remote Desktop?

In previous applications I have directed the .Save of an Excel file to a folder on the network, rather than saving it to the Remote Desktop. I'm hoping there is a similar trick floating around out there in someone's head.

VB
Private Sub CreateAppointment()
       Dim outlookReminderSubject, outlookReminderBody As String

       Dim outlookReminderDate As String = Me.dtpOutlookReminderDate.Value
       outlookReminderDate = outlookReminderDate.Split(" "c)(0)
       Dim outlookReminderTime As String = Me.dtpOutlookReminderTime.Value
       outlookReminderTime = outlookReminderTime.Split(" "c)(1) & " " & outlookReminderTime.Split(" "c)(2)
       outlookReminderSubject = Me.txbxOutlookReminderSubject.Text
       outlookReminderBody = Me.txbxOutlookReminderBody.Text


       Dim TempApp As Outlook.Application = New Outlook.Application()

       'An AppointmentItem 'TempAppItem' object represents one appointment
       Dim TempAppItem As Outlook.AppointmentItem = TempApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
       TempAppItem.Subject = outlookReminderSubject
       TempAppItem.Body = outlookReminderBody

       'Set Location
       'TempAppItem.Location = "Outer Banks"

       'Set start date and time
       TempAppItem.Start = Convert.ToDateTime(outlookReminderDate & " " & outlookReminderTime)

       'Set the end date and time - not used at the moment
       'TempAppItem.End = Convert.ToDateTime("9/3/2014 11:00:00 AM")

       'Set the Reminder time
       TempAppItem.ReminderSet = True
       TempAppItem.ReminderMinutesBeforeStart = 15

       'Choose how the time is categorized (Busy, Tentative, Free, and so on)
       TempAppItem.BusyStatus = Outlook.OlBusyStatus.olBusy
       TempAppItem.IsOnlineMeeting = False

       ' Save to Calendar.
       TempAppItem.Save()
       TempApp = Nothing
       TempAppItem = Nothing

       MsgBox("Outlook reminder created for " & outlookReminderDate & " at " & outlookReminderTime)

   End Sub


Back-up plan is to attempt to teach Outlook on the Remote Desktop to accept the Reminder, and then forward it to original creator as a calendar "invite," but that feels like cheating the system.

-Goodge
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900