View Single Post
  #6  
Old March 26th 08, 02:15 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Save a Form Region Content

How are you instantiating the targetFolder 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 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.

"morna" wrote in ...

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?



The following works well:

newItem = targetFolder.Items.Add("IPM.Appointment.MS Event")
newItem.Display

and I hooked this up to my "New MS Event" on the right click content
menu.

However, when I select the "Save" on the ribbon for this item is never
saved to the calendar. When I select the "New MS Event" from the
Actions menu, the item gets saved to the calendar. Have I missed
something here...or is it another one of those Outlook dark secret
things

-Morna
Ads