G
Guest
I'm trying to programmatically publish a form that is already stored in
personal forms library ("IPM.Appointment.Billing"). Here's how I want it to
work:
I open the Billing appointment item manually (which is default item for my
calendar folder). I make changes to Subject, Body, etc. manually.
I then click a button on a custom tab within this Billing form that
refreshes a combobox with new values from a text file. I then want to
basically save the new values in the combobox so that when I open a new
Billing item later, the combo box has the refreshed list.
I have everything working EXCEPT when I do this:
Set olNS = Item.Application.GetNamespace("MAPI")
Set MyFolder = olNS.GetDefaultFolder(9) '9=olFolderCalendar
Set MyItem = MyFolder.Items.Add("IPM.Appointment.Billing") 'This is the
class of the published form
' removed code to fill combo boxes to keep this post brief
' Debug:
MyItem.subject = "updated"
MyItem.Body = "updated"
MyForm.PublishForm 2 '2=olPersonalRegistry (Personal forms
folder)
MyItem.Close 1 '1=olDiscard
It seems to publish the form properly, but when I open a new appointment
item, it's not the updated form (subject and body are blank, combo boxes have
the original values).
Not sure what I'm missing. Am I referencing the correct Folder?
(9=olFolderCalendar). Any help much appreciated.
personal forms library ("IPM.Appointment.Billing"). Here's how I want it to
work:
I open the Billing appointment item manually (which is default item for my
calendar folder). I make changes to Subject, Body, etc. manually.
I then click a button on a custom tab within this Billing form that
refreshes a combobox with new values from a text file. I then want to
basically save the new values in the combobox so that when I open a new
Billing item later, the combo box has the refreshed list.
I have everything working EXCEPT when I do this:
Set olNS = Item.Application.GetNamespace("MAPI")
Set MyFolder = olNS.GetDefaultFolder(9) '9=olFolderCalendar
Set MyItem = MyFolder.Items.Add("IPM.Appointment.Billing") 'This is the
class of the published form
' removed code to fill combo boxes to keep this post brief
' Debug:
MyItem.subject = "updated"
MyItem.Body = "updated"
MyForm.PublishForm 2 '2=olPersonalRegistry (Personal forms
folder)
MyItem.Close 1 '1=olDiscard
It seems to publish the form properly, but when I open a new appointment
item, it's not the updated form (subject and body are blank, combo boxes have
the original values).
Not sure what I'm missing. Am I referencing the correct Folder?
(9=olFolderCalendar). Any help much appreciated.