Creating new Appointment out of Custom Form

  • Thread starter Thread starter Marc Herbrik
  • Start date Start date
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
 
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
 
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
 
Back
Top