create custom form programatically

N

NeilT

Hi,

I have a custom form in the Organisation Forms Library which is a
modified Appointment Item ie: Page 1 of the form is the normal
Appointment and Page 2 includes a couple of custom fields.

When a user saves an item to their private calendar I want to
programatically create a similar item in a public calendar (I am
modifiying Tom Howes Office Calendar).
I can create a normal Appointment item but not one with my modified
pages.

I think I need to change the content class away from the default
Appointment (IPM.Appointment) to my custom form
(IPM.Appointment.myCustomAppointment) but I can't work out the syntax

In an ideal world I could go:
Dim objNewItemInPublicFolder As New
CDO.Appointment.myCustomAppointment
but I know this is not possible

Is it along the lines of:

objNewItemInPublicFolder.Fields("urn:content-classes") =
"IPM.Appointment.myCustomAppointment"

Can someone point me in the right direction please?

Many Thanks.
 
S

Sue Mosher [MVP]

To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection. If it's a message form, you can use the Drafts folder as the target. If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object. Otherwise, you can use the code at http://www.slipstick.com/dev/code/getfolder.htm to walk the folder hierarchy and return the MAPIFolder corresponding to a given path string.

Could you just make a copy of the one in the user's calendar?

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
N

NeilT

Many Thanks Sue,

I went through slipstick.com and realised I could send a normal
appointment (IPM.Appointment) to the public folder and use a workflow to
change the message class when it arrived eg:

Workflowsession.Fields("http://schemas.microsoft.com/exchange/outlookmes
sageclass") ="IPM.Appointment.PublicCalendar"

Thanks again for your help,

Neil T
 

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

Top