Yes, but since I'm limited to what I know, I couldn't figure out the
"targetFolder" part because when the form "IS Schedule Notification" opens,
the To: is completed with four different users.
This is what I tried to use, but the TargetFolder part wasn't working.
Set newItem = targetFolder.Items.Add("IPM.Appointment.IS Schedule
Notification")
"Sue Mosher [MVP-Outlook]" wrote:
Did you try the Items.Add method that I suggested?
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"LDMueller" wrote in message ...
Hi Sue,
The form in question is an Appoinment form with a Message class of
"IPM.Appointment.IS Schedule Notification".
My original code is below and worked beautifully in Form Design when running
Forms, Run This Form. Once the form is published, it doesn't work because
I'm pointing to an .OFT file and not the Message class.
Sub CommandButton4_Click()
Set myItem = Application.CreateItemFromTemplate _
("C:\Documents and Settings\ldm\Application Data\Microsoft\Templates\IS
Schedule Notification.oft")
myItem.Display
dte = FormatDateTime(Item.UserProperties("Laptop Needed Date"), vbShortDate)
tme = FormatDateTime(Item.UserProperties("Laptop Needed Time"), vbShortTime)
myItem.Start = CDate(dte & " " & tme)
myItem.Send
End Sub
"Sue Mosher [MVP-Outlook]" wrote:
You don't need a path for the form. 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.Post.YourFormName")
If it's a message form, 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. To create an item in another person's mailbox, use Namespace.GetSharedDefaultFolder to get the MAPIFolder Otherwise, 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.
Note that code on Outlook custom forms is VBScript, not VBA.
"LDMueller" wrote in message ...
With Outlook 2003 I have two published forms. My goal is to have a command
button on one form which uses VBA code to open the other published form.
My problem is I don't know what path to use to point to the other published
form. Can someone point me in the right direction?
Thanks so much!