InfoPathEditor Fails in Outlook 2007 FormRegion

G

Guest

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.
 
G

Guest

First, a dumb question: does the outlook item get left showing in a reading
pane?

Second, can you post the relevant code (I assume you are using C# with a
replace region).

Lastly, does this work on an old style forms^3 form?

Thanks,
John

johnguin@_deletetgis_hotmail.com
 
G

Guest

John Guin said:
First, a dumb question: does the outlook item get left showing in a reading
pane?

No, the form closes.
Second, can you post the relevant code (I assume you are using C# with a
replace region).

This is a VB project. The basic code is as described in the MS samples
using a class to encapsolate each form instance being added to a list upon
opening and removed upon closing. The control was added to the form region
via the control toolbox in Outlook. The VB variables for the control, form,
and region are set to Nothing when closed (same thing occurs whether I use
the InfoPathEditor.CloseDocument() method or not).
Lastly, does this work on an old style forms^3 form?

I don't know what you are asking here. The control works fine the first
time and any subsequent times as long as there is always one of the
formregions open. It is only an issue when all formregions have been closed
and then an affected email is opened with the form.

Something that might be a factor is that it appears that closing the form
and saying you don't want to update the email prevents the email from being
modified BUT the modified email is kept in memory until Outlook is closed
when Outlook asks again if you want to save the modified email (this can be
tested by looking at any email's header using the right-click menu on any
email).
 
G

Guest

By any chance, are you leaving the item open in the preview (reading pane)?
Does it work if the reading pane is off?

Feel free to shoot me an email off this list as well -
johnguin@<<removethis>>hotmail

John
 
G

Guest

The Preview pane was off. I applied the technical refresh this week and the
problem is no longer an issue. Guess they found the bug and fixed it as
there was nothing changed from my end other than the application of the
technical refresh.

Thanks for your help.

Pete Loveall
 

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