To create a new instance in a non-default folder programmatically, use the Add method on the target folder's Items collection:
Set newItem = targetFolder.Items.Add("IPM.Appointment")
You can use the code at
http://www.outlookcode.com/d/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.
FYI, there is a newsgroup specifically for general Outlook programming issues "down the hall" at microsoft.public.outlook.program_vba or, via web interface, at
http://www.microsoft.com/office/comm...ok.program_vba
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"OscarM" <(E-Mail Removed)> wrote in message news:386A81B4-46F4-433B-9E0E-(E-Mail Removed)...
> Hi Oliver, thanks for your response. But I'm doing this through VB code.
>
> This is the code:
>
> Dim objOutlook As Outlook.Application
> Dim objAppt As Outlook.AppointmentItem
> Dim objRecurPattern As Outlook.RecurrencePattern
> Set objOutlook = CreateObject("Outlook.Application")
> Set objAppt = objOutlook.CreateItem(olAppointmentItem)
> ...
>
>
> What I would like to know is if there is a way to specify the calendar to be
> updated.
>
>
> Thanks.
> Oscar M.
>
>
>
>
>
>
> "Oliver Vukovics" wrote:
>
>> Hi Oscar,
>>
>> select the Calendar for the new appointment => In Outlook under:
>> File/New/Date
>>
>> create the new date and in the selected calendar you will get the
>> appointment. In my shared Outlook it works.
>>
>> --
>> Oliver Vukovics
>> Share Outlook without Exchange: Public ShareFolder
>> Share your contacts, calendars or e-mails
>> http://www.publicshareware.com
>>
>>
>> "OscarM" <(E-Mail Removed)> schrieb im Newsbeitrag
>> news:FDA075B2-67A3-4118-9199-(E-Mail Removed)...
>> > I'm wondering if there is a way to specify what calendar the oppointment
>> > is
>> > created in?
>> >
>> > There are three public calendars, and I want to specify in what calendar I
>> > create an appointment.
>> >
>> > Thanks,
>> > Oscar M.
>>
>>
>>