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.
e.g.
Set myFolder = objNS.Folders.Item("Public Folders")
Set myFolder= myFolder.Folders("All Public Folders")
Set myFolder= myFolder.Folders("My Public Calendar Folder")
etc.
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.
--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook!
http://tinyurl.com/ckytm
Job:
http://www.imaginets.com
Blog:
http://blogs.officezealot.com/legault/
"Keith Brown" wrote:
> 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
> calendar.
>
> 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)
> Next
>
> Set objAppt = Nothing
> Set objCopiedAppt = Nothing
> Set objNS = Nothing
> End
>
> Thanks,
> Keith