I am trying to convert some old VB code to C#, and part of it is publishing some forms to the org forms lib. In VB, the "InFolder" property was optional, but .Net requires this (presumably a side effect of interop). Whatever I try though, I get an Exception of "One or more parameter values are not valid". Any ideas? Code sample ("Microsoft.Office.Interop.Outlook" replaced with ** for tidyness) The exception occurs on the second line. String _formpath = Application.StartupPath + "\\Outlook Forms\\myform.oft"; object _obj = olApp.CreateItemFromTemplate(_formpath, **.OlDefaultFolders.olFolderCalendar); **.AppointmentItem _form = (**.AppointmentItem)_obj; **.FormDescription _formdesc = _form.FormDescription; _formdesc.DisplayName = "Opsis_Appointment _ test"; _formdesc.Name = "Opsis_Appointment _ test"; _formdesc.PublishForm(**.OlFormRegistry.olOrganizationRegistry,**.OlDefaultFolders.olFolderCalendar);
I recommend that you ask this in the m.p.exchange.development newsgroup. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "James B" <jamesb_opsis@nospam.nospam> wrote in message news:eIHhjKNkIHA.4120@TK2MSFTNGP06.phx.gbl... >I am trying to convert some old VB code to C#, and part of it is publishing >some forms to the org forms lib. In VB, the "InFolder" property was >optional, but .Net requires this (presumably a side effect of interop). > Whatever I try though, I get an Exception of "One or more parameter values > are not valid". Any ideas? > > Code sample ("Microsoft.Office.Interop.Outlook" replaced with ** for > tidyness) > The exception occurs on the second line. > > > > String _formpath = Application.StartupPath + "\\Outlook > Forms\\myform.oft"; > object _obj = olApp.CreateItemFromTemplate(_formpath, > **.OlDefaultFolders.olFolderCalendar); > **.AppointmentItem _form = (**.AppointmentItem)_obj; > **.FormDescription _formdesc = _form.FormDescription; > _formdesc.DisplayName = "Opsis_Appointment _ test"; > _formdesc.Name = "Opsis_Appointment _ test"; > _formdesc.PublishForm(**.OlFormRegistry.olOrganizationRegistry,**.OlDefaultFolders.olFolderCalendar);