I used VS 2008 and I did create the region in the designer?
In that case, you will have to write code to set the values of the Outlook properties where you want the region's control data to be stored. You could avoid that by creating the region in the Outlook designer and importing it instead of using the VS 2008 designer.
Also... when a user selects the "Save" on the ribbon of the FormRegion can I catch this event in my addin?
When the user opens the item (Inspectors.NewInspector, followed by Inspector.Activate), you can subscribe to the AppointmentItem.Save event. However, I'm not sure whether it's better to use Activate or use one of the form region events. Might take some experimenting.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"morna" wrote in message ...
On Mar 25, 1:05 pm, "Sue Mosher [MVP-Outlook]"
wrote:
VS 2008 or VSTO 2005 SE? If 2008, did you create the region in the designer or import an .ofs file?
To create a new instance of a custom form programmatically, use the Add method on the target folder's Items collection:
newItem = targetFolder.Items.Add("IPM.Appointment.MS Event")
newItem.Display
If the target is a default folder, you can use the Namespace.GetDefaultFolder method to return it as a Folder object.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"morna" wrote in ...
I have created a form region from a IPM.Appointment item and have my
new item on the Actions menu "New MS Event". Two things...when I
select "New MS Event" in a calendar I am presented with the new form
region that I created. I populate all the fields on the form region
and the select "Save" button on the Ribbon. When I select open again
on the item I saved the fields on the form region are not populated.
I have this built within a VSTO addin and I can catch the
FormRegion_FormRegionClosed(..) event.. should I be saving the content
of this form region or should Outlook be saving the content? Does
anyone have a code example?
Also - I would like to put a "MS Event" commandbar on the content menu
when a user right clicks on the calendar - I have a commandbar
included there, however don't know what to put in the event handler to
make the new form region to appear...anyone got any thoughts?
Thanks for your time.
-Morna- Hide quoted text -
- Show quoted text -
Hey Sue -
I used VS 2008 and I did create the region in the designer?
How can I get a hook to the FormRegion.cs object from the ThisAddin
class? Also... when a user selects the "Save" on the ribbon of the
FormRegion can I catch this event in my addin?
I can create a new appointment item on the fly if I can catch the save
event and the use UserProperties to save fields that are not really in
the IPM.Appointment object and save them to the MS Event folder if I
can catch the "Save" event that fires when a user selects the "Save"
on the ribbon of the FormRegion... just thinking out loud.
Thanks so much for your time.
-Morna