InfoPath 2007 – There has been an error while loading the form

You updated an existing template with some new fields and data connections then published the form to the library. now users are unable to open any of the older forms they had saved. before the current update users were able to open all the forms with ie.

Error:

There has been an error while loading the form.
 
Click Try Again to attempt to load the form again. If this error persists, contact the support team for the Web site.Click Close to exit this message.

This form template is not currently browser-enabled. It must either be republished as a browser-enabled form, or opened using Microsoft Office InfoPath 2007.

—————————–

the problem is the older forms are referencing the old template, in my case it was templateOLD.xsn. All i had to do was update all the old forms… below is a block of code that will help you do this. (the forms Modified date and Modified by will change to the current date and the users name that is updating the forms)

Imports System.Text.RegularExpressions

Dim sPath As String
Dim sText As String

For Each file As String In IO.Directory.GetFiles(“\\sharepointed.com\ehaze”) ‘location of your doc library

sPath = file
sText = My.Computer.FileSystem.ReadAllText(sPath)

sText = Regex.Replace(sText, “templateOLD.xsn”, “template.xsn”)

My.Computer.FileSystem.WriteAllText(file, sText, False)

Next

2 thoughts on “InfoPath 2007 – There has been an error while loading the form

Leave a Reply

Your email address will not be published. Required fields are marked *