InfoPathEditor Failing in Outlook 2007 FormRegion

P

Pete Loveall

I am using the InfoPathEditor control (InfoPath 2007) in a FormRegion in
Outlook 2007 (don't ask, suffice it to say the integrated InfoPath support is
not what we need). I must use the ActiveX control as Outlook 2007 does not
support managed controls in the forms.

I have written an addin which basically mirrors the MS article on adding
formregions using an addin. When the formregion is activated for a read, I
execute a LoadFromStream using a stream created using CreateStreamOnHGlobal
(the same error occurs when I use a file name and use the Load method). I am
doing nothing else with the form at this time except displaying it.

This all works fine the first time through and forever as long as one form
stays open (doesn't matter whether it is the first or one opened after the
first and then closing the first one). However, if I open a message in the
form (the formregion is a ReplaceAll region on IPM.Note.xyz where xyz is a
dummy form name) and then close it, all further attempts to open a message in
that form produce a COM error which reports that InfoPath is unable to open
the form due to an error in the code (there is none in the form). The error
reported by InfoPath is that "Index refers beyond end of list" which is an
XML parsing error. Yes, the file is exactly the same being passed to the
control's load commands.

The interesting part of this is that as long as I leave a form open with the
control in it, it works without error every time. I am going to cross-post
this to the Outlook group since this may be an Outlook clean-up issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top