> It looks more or less OK to me.
>
> Does it help any if you cast everything as you retrieve it? Are all your
> objects OK if you step the code in the debugger?
>
> --
> Ken Slovak
> [MVP - Outlook]
>
http://www.slovaktech.com> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
>
http://www.slovaktech.com/products.htm>
>
> "spareway" <spareway[ at ]gmail.com> wrote in message
> news:1168877934.312069.315800[ at ]11g2000cwr.googlegroups.com...
> > Hi,
> >
> > I am trying to publish a form via an outlook addin. When I call
> > Publish Form, I get an exception that says: one or more paramters are
> > incorrect.
> >
> > any ideas?
> >
> > thanks,
> >
> > craig
> >
> >
> > Outlook.MailItem theItem;
> > Outlook.FormDescription theDesc;
> >
> > //Environment.GetFolderPath(Environment.SpecialFolder.Personal)
> > Ol.MAPIFolder draftFolder =
> > OutlookApp.Session.GetDefaultFolder(Ol.OlDefaultFolders.olFolderDrafts);
> > theItem = (Outlook.MailItem)
> > this.OutlookApp.CreateItemFromTemplate(formPath, draftFolder);
> > theDesc = theItem.FormDescription;
> > theDesc.DisplayName = formName;
> >
> > Ol.MAPIFolder inboxFolder =
> > OutlookApp.Session.GetDefaultFolder(Ol.OlDefaultFolders.olFolderInbox);
> > theDesc.PublishForm(Outlook.OlFormRegistry.olPersonalRegistry,inboxFolder
> > );
> > theItem.Close(Outlook.OlInspectorClose.olDiscard);
> >