Developing IP2003-compatible forms in IP2007 - David Airapetyan

InfoPath Dev

David Airapetyan

Developing IP2003-compatible forms in IP2007

So you have finally upgraded to the latest and greatest Office 2007. Wonderful! You can now design and deploy the new shiny InfoPath 2007 solutions along with the ability to publish to the Forms Server! But there is a problem – your friends at the university who are using the beautiful workflow solution you have developed for them are still using InfoPath 2003. Now that they have asked you for a new feature, what do you do?

One option would be to have both InfoPath 2003 and InfoPath 2007 (if you can, use two different machines because side-by-side might cause problems especially if you are writing code). However, there is a better solution! It turns out that InfoPath 2007 can let you develop and save solutions in IP2003 format. Now, let’s talk about migration.

1. You have developed your InfoPath 2003 solution without using code or you have used JavaScript. There is nothing to do – just open your solution in InfoPath 2007 Designer and everything will work.

2. You have developed your InfoPath 2003 solution with .NET business logic using either the VS.NET or VS2005 InfoPath toolkit. Things get a bit trickier here. InfoPath 2007 is supposed to be able to migrate those for you automatically but I had many problems getting this to work. Here are some good workarounds to get you going:

2a. You do not have Visual Studio installed. In this case, your only option of developing InfoPath business logic with .NET is to use the built-in Visual Studio Tools for Applications (aka VSTA). Here is how you can manually migrate your code:

- Open your form in the 2007 Designer

- Select Tools | Form Options – Programming and click "remove code"

- In the "Form Template Code Language", select C# (InfoPath 2003 compatible ) – or VB, if you’d like

- Tools | Programming – Visual Studio Tools for Applications

After it has generated a new FormCode for you, copy-paste your code over (you might need to re-create all the handlers)

Voila! Now you can design and develop in IP2007, write business logic and once you deploy the solution, it will work on both IP2007 and IP2003.

Note that VSTA is not as rich of an environment as the full-blown Visual Studio so there will be some things you won’t be able to do such as having multiple projects in your solution.

2b. You have Visual Studio 2005 installed. This is good news! You can now take full advantage of VS2005 with Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System (VSTO 2005 SE) available for download at this address:

Here are the migration steps here:

- In Visual Studio, File | New Project

- Select Office | InfoPath Form Template, click OK

- The InfoPath 2007 Designer dashboard comes up. Select you existing form by clicking "On My Computer" under "Create project from existing form template"

- This will copy the original form into a new location (the one you have specified when creating the project) without affecting your original solution

- When you clone a solution this way, InfoPath 2007-based FormCode is automatically added to your code. You don’t want this, so the code has to be replaced:

- Select Tools | Form Options – Programming and click "remove code"

- In the "Form Template Code Language", select C# (InfoPath 2003 compatible ) – or VB, if you’d like

- In the solution explorer, open FormCode.cs (or the VB equivalent) and paste your original code in there.

- Open the manifest in Visual Studio and navigate to the Insert | On Load Event method via Visual Studio menus to ensure InfoPath re-creates the solution DLLs.

You’re ready to go!



Divvvvv said:


When I install VSTO 2005 SE, i do not get any option of infopath project tempalte in visual studio, i only get option of add in.

Please let me know how an I create a new infopath form template from an exisiting infpath form template?


September 16, 2008 12:56 AM

Error message:Infopath created in newer version 12.0.0 | keyongtech said:

Pingback from  Error message:Infopath created in newer version 12.0.0 | keyongtech

January 21, 2009 5:00 PM

SamCamblin said: says:

"In addition to the procedures below, you must also click Save As on the File menu, and then select InfoPath 2003 Form Template (*.xsn) in the Save as type box to save the form template to the InfoPath 2003-compatible file format. Also, to open InfoPath 2003-compatible form templates created with Office InfoPath 2007, all InfoPath 2003 users must have the .NET Framework 2.0 installed on their computers (not .NET Framework 1.1 as is the case with managed code form templates created with the one of the InfoPath 2003 Toolkits for Visual Studio)."

December 15, 2009 8:19 AM

About davidair

I am a Computer Science graduate from McGill University in Montreal, Canada. I have over seven years of industry experience including almost five of them spent with the Microsoft Corporation where I shipped several versions of Microsoft Office InfoPath. Originally from Russia, I am fluent in several languages, including Russian, English, French, C#, C++ and Perl. I currently reside in Montreal and work for Qdabra Software.
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.