InfoPath 2007 (2003 custom-code compatibility)

S

Smolakm

Here is my issue:

Software installed:
Visual Studio 2005, InfoPath 2007, InfoPath Toolkit for Visual Studio 2005
(Beta2 Support)

Created form in InfoPath 2007.
Placed in a single text box called field1 and kept all default settings for
it.
I saved it in an InfoPath 2003 compatible format.
Created a new project in VS 2005 based on the IP 2003 compatible form.
Went into Tools > Form Options > Programming.
I clicked Remove Code and then set the template code to “C# (InfoPath 2003
Compatible)â€
I then added the following lines of code to the FormCode.cs file (after the
_Shutdown() method):

[InfoPathEventHandler(EventType = InfoPathEventType.OnLoad)]
public void OnLoad(DocReturnEvent e)
{
String xpath = "/my:myFields/my:field1";
IXMLDOMNode field1= thisXDocument.DOM.selectSingleNode(xpath);
field1.text = "Test Successful";
}

When I compile the project it compiles successfully.
When I start it without debugging (ctrl + f5), the form opens but the
field's text does not get set.
When I place a break at any line within my custom code and start it with
debugging (f5), the break point is never hit. The form loads but the field
is not set.

It’s as if, when using the InfoPath 2003 Object Module, the InfoPath toolkit
for VS 2005 does not work and the custom code is ignored.

Has anyone experienced this and if so, have you found a way around it?
Thank you
 

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