Creating new Appointment out of Custom Form

M

Marc Herbrik

Hi,

I need help! How do i create a Appointment out of an Custom Appointment
form.

Details:

i have a Custom Appointment Form with Two Fields! One named Date an one
named Begin. I also have a Button to Create a Appointment.

Problem:

Everytime i create an Appointment Outlook creates an normal Appointment. I
need to have the same Custom Appointment.

Code on the Create Button:

Sub CreateAppointment_click()


'msgbox
Item.GetInspector.ModifiedFormPages.Item("Bericht").Controls("NächsterTermin").Text
& " " &
Item.GetInspector.ModifiedFormPages.Item("Bericht").Controls("TStart").Text

Set NewAppointmentItem = Application.CreateItem(1)

NewAppointmentItem.MessageClass = "IPM.Appointment.Vertriebstermin"

NewAppointmentItem.Start =
Item.GetInspector.ModifiedFormPages.Item("Bericht").Controls("NächsterTermin").Text
& " " &
Item.GetInspector.ModifiedFormPages.Item("Bericht").Controls("TStart").Text

NewAppointmentItem.Duration = 60

'NewAppointmentItem.Subject = "This is a test appointment"

'NewAppointmentItem.Location = "Timbuktu"

'NewAppointmentItem.Body = "This is just a test appointment - nothing to be
concerned about!"

NewAppointmentItem.Display()

End Sub





Thx for your time!

Regards Marc
 
S

Sue Mosher [MVP-Outlook]

To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Appointment.YourFormName")

If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a MAPIFolder object.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

Marc Herbrik

THX Sue

It worked perfectly.

Regards Marc

To create a new instance of a custom form programmatically, use the Add
method on the target folder's Items collection:

Set newItem = targetFolder.Items.Add("IPM.Appointment.YourFormName")

If the target is a default folder, you can use the
Namespace.GetDefaultFolder method to return it as a MAPIFolder object.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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