I am trying to using VBA to create calendar appointments using data found in specific cells of a workbook.
The code works and it has no issues creating the appointments.
The problem is: It only creates appointments in my own personal calendar. (The first calendar everyone has.)
I want the ability to create appointments in my own sub calendars or in a shared folder.
Attached picture: The Green boxes are where I would like the appointments to go. The Red box is where the code currently puts everything.
I've been trying to use code from another thread to troubleshoot doing that but I haven't been successful.
The other thread: Creating an Outlook Appointment in a shared calendar
@John_w has done a lot of great work in that thread helping/explaining.
The code I'm using to try and learn about the "Tour" calendar folder.
The output:
Calendar
\\JOHN.SMITH@micro.gov
The above code works but anytime I try and substitute or add "Tour" into anything, it breaks.
I also can't figure out how to point it at a Shared Calendar.
Any assistance would be greatly appreciated.
The code works and it has no issues creating the appointments.
The problem is: It only creates appointments in my own personal calendar. (The first calendar everyone has.)
I want the ability to create appointments in my own sub calendars or in a shared folder.
Attached picture: The Green boxes are where I would like the appointments to go. The Red box is where the code currently puts everything.
I've been trying to use code from another thread to troubleshoot doing that but I haven't been successful.
The other thread: Creating an Outlook Appointment in a shared calendar
@John_w has done a lot of great work in that thread helping/explaining.
The code I'm using to try and learn about the "Tour" calendar folder.
VBA Code:
Sub CalendarChecker()
Dim olApp As Outlook.Application
Dim outNameSpace As Namespace
Dim outSharedName As Outlook.Recipient
Dim outCalendarFolder As MAPIFolder
Dim olAppItem As Outlook.AppointmentItem
Set olApp = CreateObject("Outlook.Application")
Set outNameSpace = olApp.GetNamespace("MAPI")
Set outCalendarFolder = outNameSpace.Folders(John.Smith@micro.gov)
Set outCalendarFolder = outCalendarFolder.Folders("Calendar")
Debug.Print outCalendarFolder.Name
Debug.Print outCalendarFolder.FolderPath
End Sub
The output:
Calendar
\\JOHN.SMITH@micro.gov
The above code works but anytime I try and substitute or add "Tour" into anything, it breaks.
I also can't figure out how to point it at a Shared Calendar.
Any assistance would be greatly appreciated.