How To Embed a Web Page in an InfoPath Form

Purpose

This document will give you an in-depth idea on how to embed a Web page within an InfoPath form. The Web page can be invoked with different URLs on click of a button.

The proposed solution below will help us avoid using Activex controls to act as custom controls within an InfoPath form. This will also avoid the problems of having a webBrowser control within an Internet browser page (see this article).

It is nearly impossible to add an iframe to the Xdocument.DOM of InfoPath.

Sample Scenario

An application form has to get details from a given URL in the InfoPath page. The user will click on the URL and the Web page will be populated within the InfoPath form, so that the user doesn't have to navigate out or switch to a different browser window.

Solution

A new TaskPane will be created and associated with the InfoPath form. This TaskPane by default will take a simple user created HTML page. On click of the button to the right of the given URL, TaskPane will be navigated to that specific URL. This is done by invoking an onclick event which navigates the TaskPane to the given URL.

Step By Step Walk-through

Open Notepad and paste the following:

<HTML><body>
Click on the Go button against the URL to open the web page
</body></HTML>

Note: If you would like to publish this form to public, you need to remove the security restrictions.

Go to Menu/Tool/Forms Options/Security

Uncheck “automatically determine security..”

Check Full Trust option

Check ‘Sign this form” and create or use a certificate

Install this certificate in the client computer where you use this form.

Conclusion

This is a simple solution for having a Web page within an infoPath form. Task Pane can be moved to any corner of the infopath window as per user’s convenience. Security levels of the forms have to be decided as per the requirements.