Search
Web Braintrove
Site Navigation
Home
Products
Tags
Levels
Dates
Authors
5 MOST RECENT
Quickly Crop to a Shadow
Sum Repeating Time Values
Preview and Open Forms after Upgrading to Internet Explorer 8
Eliminate NaN and Infinity Errors in Calculations
Force a Field Value to a Number Using Rules
5 MOST POPULAR
Pass Query String Parameters to an ASP.NET Xml Control
Prevent Namespace Prefixes from Being Copied to the Output
Access a Method in a Master Page with Code-Behind
Create Groups in a Drop-Down List Box
Change the Default Action of the Power Button on the Windows Vista Start Menu
5 MOST FORGOTTEN
Configure Windows to Show Clocks for Multiple Time Zones
Create a Yellow Neon Text Effect Using Styles
Permanently Change the Default Styles for New Word Documents
Select Table Row Counts as Columns
Prevent Mouse Settings from Reverting To Default on Restart
Microsoft MVP
Popular
This article has been viewed 696 times.

Get InfoPath to Preview VSTO and VSTA Projects

Page 1 of 7
Written by Gregory Scot Collins
Friday, 29 February 2008, 5:08 AM
This article has been tested to work with the following products and versions. No guarantee of compatibility, with or without modification, is offered for products or versions other than those listed.

The issue

While attempting to preview a Visual Studio Tools for Office (VSTO) or Visual Studio Tools for Applications (VSTA) InfoPath project you might get a rather unhelpful error message telling you that "InfoPath cannot open the selected form," as shown in Screenshot 1. If this can occurs for a brand new, freshly created managed code project, but does not occur with a codeless or script-based form, then you need to read on.
The lack of preview capabilities while building an InfoPath form template can be extremely aggravating. Preview is essential to the development workflow allowing you to quickly test changes and progress.
There are various reasons you could receive this error message. You will see it if you attempt to preview a form that is already being previewed. I have, on occasion, received this message for a form template that was previewing just fine moments before, and then stopped after some changes I made—an issue for which I still have not found a reason. However, this article is not about those scenarios, but rather the scenario where you can never preview a managed code project, even a brand new, freshly created, blank one.

Domains and security zones

The error stems from security issues due to being part of a workgroup rather than being joined to a domain. Any machine joined to a domain will not experience this issue because it has a detectable intranet while machines that are part of a workgroup don't, and therefore can experience the issue.
InfoPath uses the Windows Internet (WinINet) application programming interface (API) to define many of its security settings and subsequently depends heavily on Internet Explorer settings. When not joined to a domain, an intranet is not detected and the InfoPath form is opened in the more restrictive Internet zone rather than the Intranet zone. Because it is considered a more controlled environment, security settings for the Intranet zone are less restrictive. Forms with managed code (i.e. VSTO and VSTA projects) are, by default, not allowed to open in the Internet zone, effectively disabling your ability to preview your form template.
Bookmark this Article
StumbleUpon  Stumble It!
Digg  Digg It!
del.icio.us  del.icio.us
List of Figures
Screenshot 1 - An error dialog while trying to preview a VSTO or VSTA InfoPath project.
Screenshot 2 - Disabling automatic intranet detection in Internet Explorer.
Screenshot 3 - A site that has been manually added to the Local Intranet zone.
Screenshot 4 - Establishing a domain impersonation for previewing a form template.
Listing 1 - The zone attribute flag enumeration.
Article Tags
Great Deals
PRE-ORDER Windows 7 and SAVE over 50% at TigerDirect!
Find all current special offers on Adobe products.
Try SugarSync Free!
Join WebHost4Life.com
TigerDirect
Computers4SURE (4SURE.com - An Office Depot Co.)
Copyright © 2006-2009 Braintrove. All rights reserved. Braintrove, braintrove.com, and the Braintrove logo are trademarks of Gregory Scot Collins in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners. Any rights not expressly granted herein are reserved.