View Single Post
  #6  
Old June 14th 07, 04:48 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,951
Default Adding appointment to non default calendar

Are you positive the problem calendar is really in the same store (PST file
or Exchange mailbox) as the default calendar? It sounds to me like it's in a
different store.

If it's a different store than you can iterate the NameSpace.Folders
collection. Each top level folder there is a different store and you can
then iterate that store to find a specific folder. If you are using Outlook
2007 it's even easier, any loaded store is in the Stores collection.

To add an item to a specific folder instead of the default folder for that
type of item use the Folder.Items.Add method instead of CreateItem. That
always places items in the default folder for that type of item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Andy Pope" wrote in message
...
More info....

I tried adding a New calendar and this DOES appear as a folder item and I
can loop through the .Folders collection and locate it.
I'm now doubting my sanity about how I created the other calendar which I
can not see.

But I still have the problem of adding an appointment item to a specific
calendar as the current code adds the appointment to the Outlook
application rather than a specific calendar.

Set objItem = objOL.CreateItem(olAppointmentItem)

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


Ads
 

Find Local Jobs - Loans - Bankruptcy - Online advertising - Loans