Copy Appointments to Exchange Calendar



I am using Outlook 2003. I download all my emails, appointments, etc. to my
local machine to the .pst file. When I accept a meeting it shows up on my
local calendar. I share out my calendar on the Exchange Server and so I have
to manually copy all my meetings to the Exchange calendar on a daily basis to
make sure people who are trying to invite me to meetings can see the latest

I saw a post recently where the user wanted to copy items from a selected
calendar to the default calendar. I have included that code below, it works
great. However, are there modifications that can be done to it to make it
copy the selected appointments and copy them from my default calendar to the
calendar on the exchange server?

Sub CopyAppointmentItem()
Dim objNS As Outlook.NameSpace
Dim objAppt As Outlook.AppointmentItem
Dim objCopiedAppt As Outlook.AppointmentItem

If ActiveExplorer.Selection.Count = 0 Then Exit Sub

Set objNS = Application.GetNamespace("MAPI")
For Each objAppt In ActiveExplorer.Selection
Set objCopiedAppt = objAppt.Copy
objCopiedAppt.Move objNS.GetDefaultFolder(olFolderCalendar)

Set objAppt = Nothing
Set objCopiedAppt = Nothing
Set objNS = Nothing



To copy the selected appointments to a non-default Calendar, you need to
obtain a MAPIFolder reference for that folder by walking the Folders
collection of the Public Folders.


Set myFolder = objNS.Folders.Item("Public Folders")
Set myFolder= myFolder.Folders("All Public Folders")
Set myFolder= myFolder.Folders("My Public Calendar Folder")

Otherwise, if you know the EntryID of the public folder, you can call the
NameSpace.GetFolderFromID method to obtain it directly without any folder
parsing required.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question