Microsoft InfoPath 2010
The official blog of the Microsoft InfoPath team

  • Microsoft InfoPath 2010

    Information Rights Management: Protecting Forms


    In a recent post, we discussed ways to protect sensitive data in your InfoPath forms. This article will drill down on one of these mechanisms - Information Rights Management, a.k.a. IRM. InfoPath 2007 features the ability to set permissions on both the form template that you’re designing and the forms that are based on it. You can choose to restrict who can read or write your form/form template, as well as whether read permissions include the ability to copy, print, etc. This feature is available in the both the designer and editor by clicking the Permission button on the Standard toolbar:

    Form instance permissions
    When filling out a form, users can set permissions for that particular form. Clicking on the Permissions button in the Standard toolbar will pop up the following dialog:

    The user that created that instance of the form will have full control permissions and can grant read or write permissions to other users. Users that do not have any permissions to that form will not be able to even open it.

    This feature can make InfoPath a great tool for scenarios where some degree of privacy is required, for example, feedback to a manager to peer.

    Form template permissions
    In addition to setting permissions for each individual form that is filled out, InfoPath also provides Permission functionality for the form template. When designing a form template, clicking on the Permissions button will pop up the Permission dialog:

    The ‘Restrict permission to this form template’ checkbox at the top will initially be unchecked – check it to turn on Permissions. You will then be able to select users or groups that will have different levels of permissions for this form template.

    Keep in mind that this area only allows you to control access to the form template itself, not to the forms that are based upon it. To restrict permissions to the forms based on this form template, you would check the second checkbox, ‘Restrict permission to forms based on this form template’:

    As mentioned for users setting these permissions in the editor, the user that created the instance of the form will always have Full Control permissions for that form instance, but you can get more specific by clicking ‘Change permissions…’. Here you’ll be able to select who will have Read and Change permissions and which additional features will be available to users.

    If you are designing a form for your specific team, you can take advantage of this feature to only give Write rights to members of the team. Everyone else can be given Read rights.

    Managing your credentials
    When working with InfoPath forms or form templates that have restricted permissions, you can select an account to access the content with. For example, if your personal e-mail address does not have permissions to view an expense reporting form, you can set InfoPath to use your work address instead.

    You can access this feature by clicking on Manage Credentials in the File menu:

    Thanks all. I hope you find this useful.

    One thing to keep in mind is that IRM is not a security feature – there are ways to get around it. It’s there to make it more difficult for users to accidentally or maliciously tamper with sensitive data.

    Program Manager

  • Microsoft InfoPath 2010

    All you wanted to know about browser compatibility


    These articles will help you answer many of the questions you might have about Forms Services browser compatibility, rich-client only features, and the Design Checker.




    Plan browser support (OSS)

    Describes the different levels of browser support for MOSS.


    Creating InfoPath Form Templates That Work With Forms Services

    Describes the following:

    1. Features supported by both InfoPath and Forms Services
    2. Features not supported by Forms Services
    3. Object Model that works in Both InfoPath and Forms Services
    4. Object Model that works only in InfoPath


    Web browser compatibility in InfoPath Forms Services

    Describes the following:

    1. Which browsers are compatible with Forms Services?
    2. Which InfoPath 2007 features are supported in browser-enabled form templates?


    InfoPath 2007 features that are unavailable in InfoPath Forms Services

    Describes the following:

    1. Controls that work in both InfoPath and Forms Services
    2. Controls that work only in InfoPath (lists Design Checker errors and messages)
    3. Features that work in both InfoPath and Forms Services
    4. Features that work only in InfoPath (lists Design Checker errors and messages)


    Microsoft Office server system requirements

    Describes system requirements for all server products, including browser requirements.



    Senior Writer

  • Microsoft InfoPath 2010

    Take a list offline using SharePoint Workspace 2010


    In this short video demo, Shirish Pulikkal from the InfoPath test team shows how you can customize a SharePoint list in InfoPath designer and work with the list offline in SharePoint Workspace.

    The Scenario: A fictitious company Fabrikam wants to track assets in their lab using SharePoint list. They want to be able to track assets both in the online and offline case. Fabrikam has decided to use InfoPath to customize the list and SharePoint workspace to enable working offline with the list.

    The Process: We start by customizing the form for the SharePoint list in InfoPath designer and add a secondary data connection to pull data from another SharePoint list. Then we publish the form back to the SharePoint list and sync it in SharePoint Workspace. Now we can create list items while working offline in SharePoint Workspace and items can be synced to SharePoint server when we get back online.

    Get Microsoft Silverlight

  • Microsoft InfoPath 2010

    Executing menu and toolbar commands from the InfoPath Object Model


    While the InfoPath 2003 SP-1 object model is quite extensive, it doesn’t provide all the functionality that is exposed through the InfoPath menus and toolbars. However, you are not limited by that fact. Using the CommandBars object, you can access any of the functionality available in menus and toolbars.

    For example, the InfoPath object model exposes a Print method but not a PrintPreview method.  However, that doesn’t mean that you can’t access this functionality.  Using the CommandBars object, you can execute the Print Preview functionality available on the Standard toolbar like so:

    Application.ActiveWindow.CommandBars(“Standard”).Controls(“Print Preview”).Execute();

    The list of available command bars is on the View | Toolbars menu. If you want to access a menu item, use “Menu Bar” for the command bar name. The control name to use is the same name that appears on a menu or in the tooltip when the mouse is hovered over a toolbar button. (Please refer to MSDN ( for more information about the CommandBars object.)

  • Microsoft InfoPath 2010

    Do it anyway: Submitting with Data Validation errors

    When building a workflow solution using InfoPath, it is often necessary to enforce data validation for some, but not all users. For example, in a simple expense report workflow, Employee->Manager->Accounting, the manager may be required to specify the cost category. The employee, however, can't provide this data. This means that setting the "cannot be blank" property for the costCategory field in the InfoPath form will not be enough to make this work. In this article, we will explore a technique that will let you use powerful InfoPath data validation capabilities to enforce this business logic correctly.
    You may have seen a different incarnation of the same problem - "if only I could submit the form with data validation errors...". If so, read on.
    1. Create a node in your data source that remembers the role of the current user; let’s call that node userRole. Create rules or code to get that node populated on load of the form.

      Trick 1 - acquiring user role. To set the value of a node to the current user role in rules, use the XPath expression xdXDocument:get-Role().

      Trick 2 - acquiring Active Directory username.  If you are using InfoPath 2007, you can get to the username of the current user through the built-in userName function. In InfoPath 2003, the easiest way to accomplish this is to write a simple whoAmI web service (here is a sample implementation), and plug it in to your form template through a secondary data connection.

    2. Setup data validation logic on the costCategory field by using the Data Validation dialog (not through the “cannot be blank” shortcut in the properties dialog).

    3. Add a new "logical and” clause to the data validation condition. This clause will check if the userRole actually requires the field to be filled out. The entire data validation condition will evaluate to false if the userRole doesn't have this requirement, and the error message will not be shown:
    This technique will work in both InfoPath 2003 and InfoPath 2007, and it is supported in browser-enabled form templates.
    Alex Weinstein
    Program Manager
  • Microsoft InfoPath 2010

    Save the Date! Using Horizontal Repeating Sections

    InfoPath 2007 introduces a new flavor of the repeating section control - horizontal repeating section. It is useful when you want to present or edit repeating data in a structured format. When new items are added, they show up side-by-side with the existing items instead of one on top of the other.
    Horizontal repeating section is a new building block for layouts. In my previous post about horizontal repeating tables, we discussed how a horizontal repeating table is a combination of a horizontal repeating section and layout tables. You can make your own new layouts by using this new control.
    For example, one cool use of a horizontal repeating section is a "calendar" - style form:
    Play with it!
    Download the form template and try a few things (requires InfoPath 2007, and save it to your computer before opening it):
    1. Switch to a different month by using a dropdown on top of the form.
    2. Add a note for a day.
    3. Add a note with an exclamation sign (i.e. "presentation!") - notice the day turning red.
    4. Switch views to the summary view, and observe all appointments as a flat list.
    5. Open the form template in design view, and view its logic by going to Tools | Logic Inspector.
    How it's done
    In this form, each day in the calendar is displayed by using a horizontal repeating section; only the header ("Monday, Tuesday, Wednesday…") is static. To accomplish this, we are using several powerful tricks:
    1. Calendar generation is completely dynamic. To generate a view of a different month, we are setting the following fields in the form under myFields/currentMonth:
      • firstDay [date field in XML format (YYYY-MM-DD); set to the first day of the month that you want to view the calendar for - i.e. for May 2007, set to "2007-05-01"]
      • numberOfDays [integer; number of days in the month that you want to present; i.e. for May 2007, set to "31"]
      • mondayOffset [integer; weekday of first day of the month; Sunday=0, Monday = 1, Tuesday = 2, etc. I.e. for May 2007 that starts on Tuesday, set to "2"]

      Note that if you wanted to extend this calendar to show additional months, you could do so by adding rules to set these parameters for different months. It's also easy to move this logic to a web service or form code - thus eliminating the need to maintain a static list of months.
    2. Horizontal Repeating Sections wrap when placed inside a table. The wrapping point is determined by table width. This allows us to set up a 7-day-long week.

    3. Conditional formatting works just as expected on horizontal repeating sections. This allows us to highlight today's date, set red background for days marked with an exclamation sign, and set correct background color for weekends.

    4. Default values help us create a necessary number of instances of the horizontal repeating section to cover for the longest month, even if it starts on Saturday. We need 6 instances to cover for "blank" days before the first day of the month, plus a maximum of 31 days in a month = 37 instances. To accomplish this, you can follow the technique from this article.

    5. Rules provide a mechanism for month selection: when a month is selected from the dropdown on top of the form, correct values are set for nodes under myFields/currentMonth.
    Of course, there are many uses beyond a calendar, otherwise we would have just built a calendar control, but we couldn't resist sharing this example because it shows off so many tricks.
    Alex Weinstein
    Program Manager
  • Microsoft InfoPath 2010

    Getting the XPath without straining your brain

    Yesterday I talked about using System.Xml in the new object model. My code examples included a key part of the InfoPath programming model: looking up fields in the data source using XPath so that you can set and get values.
    Unfortunately, figuring out the absolute XPath to a field can be a pain.
    Fortunately, we've made that easy in InfoPath 2007.
    Here's how
    Right click the field in the Data Source task pane and click Copy XPath
    Now you can paste the XPath into your code and be on your merry way.
    Hope that helps,
  • Microsoft InfoPath 2010

    Cool video on InfoPath in Outlook

    As part of getting everyone up to speed on Office 2007, and in preparation for the imminent release of the Beta, we've just posted some "Partner technical readiness training" videos.
    It includes a great one on using InfoPath in Outlook, so I thought I'd call it out:
    You can check out all the videos here:
  • Microsoft InfoPath 2010

    Auto height for sections

    InfoPath forms are all about being dynamic, so it's important that the sections in your form grow and shrink appropriately. For example, if someone deletes an optional section from inside another section, the outer section should shrink accordingly.
    Of course, sections will grow/shrink by default after you insert them, but InfoPath will change it to a fixed size if you resize the section, since we don't want to disobey your command to be a specific size. So in the example above, the outer section will stay the same size even when the Notes section isn't there -- it will just have a bunch of white space in its place.
    The trick: Use "auto"
    If you resized a section by accident and want to return it to the default, just open its properties, switch to the "Size" tab, and type auto for the height. Now it will only be as big as it needs to be and never bigger.
    - Ned
  • Microsoft InfoPath 2010

    Adding a Data Connection to Some WebServices Cause InfoPath 2003 to Disappear


    When adding a web service data connection to an InfoPath 2003 form template, there is a bug that will cause InfoPath 2003 to disappear if the web service’s WSDL contains a particular recursive schema construct.  The following snippet of XSD illustrates the issue:


    <xs:element name="RecursiveRoot">



    <xs:element name="Branch1" minOccurs="0">



    <xs:element ref="ns:RecursiveRoot " maxOccurs="unbounded" />




    <xs:element name="Branch2" minOccurs="0">



    <xs:element ref="ns:RecursiveRoot" maxOccurs="unbounded" />








    This XSD contains a recursive structure in which there is more than 1 path of recursion and the recursive root is not marked as an optional element in the XSD when referenced.  InfoPath 2003 will work with the WSDL containing this XSD as expected if both references to RecursiveRoot were optional as illustrated in the following modified XSD (changes in red).


    <xs:element name="RecursiveRoot">



    <xs:element name="Branch1" minOccurs="0">



    <xs:element ref="ns:RecursiveRoot " maxOccurs="unbounded" minOccurs="0"/>




    <xs:element name="Branch2" minOccurs="0">



    <xs:element ref="ns:RecursiveRoot" maxOccurs="unbounded" minOccurs="0"/>








    If you are having issues with a web service that you own, one work around to this issue with InfoPath 2003 is to modify the WSDL for your web service as shown above.  In the case that this is not an acceptable work around, or you do not own the web service, the following steps will help you work around the problem:


    1.      Download the WSDL file for the web service to your local machine


    2.      Modify the XSD in the WSDL as shown above


    3.      Add a Data Connection to the local version of the WSDL file


    If you are setting up a submit or receive/submit web service connection then the following steps are required as well to ensure that the data InfoPath submits to the web service adheres to the original schema:


    4.      File --> Extract Form Files to save your form template in an uncompressed format


    5.      Remove the modifications made to the WSDL XSD in the copy of the XSD that was added to the form template


    If you modify the data connection or add another data connection to this local WSDL file for a submit web service then steps #4-#5 will have to applied again.  If you expect other users to modify the design of this form template then the local version of the WSDL should be stored in a shared location that all designers have access to.


    This issue has been reported to the InfoPath team as occurring in the ItemLookup method of the web services that Amazon exposes (  In the case of this method, the modification that is necessary to avoid the InfoPath 2003 bug (step #2) is the following:


    1.       Find the BrowseNode element that contains references to other BrowseNode elements

    2.       Add minOccurs=”0” to the BrowseNode references (these occur under the “Children” element and the “Ancestors” element)


    Since ItemLookup is a receive only method, there is no need to modify the form template files by hand (steps #4 and #5).


  • Microsoft InfoPath 2010

    Move Up/Move Down


    One stumbling block for developers coming up to speed on InfoPath is that the SDK documentation leads you to the edge of the XML cliff and then goes mysteriously quiet. For web developers who have programmed applications with the MSXML SDK for manipulating XML this isn’t a problem – they brought their parachute with them and happily jump off. For others, this can be a little intimidating.

    Here’s a good way to get started manipulating the XML DOM directly – let’s add “Move Up” / “Move Down” buttons to a Repeating Table so you can re-order the items.

    First off, let’s build the view:

    1. Fire up InfoPath 2003 and start a new blank form
    2. Insert a Repeating Table from the Controls task pane
    3. Delete the text box in the last column, and add two buttons in that cell instead
    4. Pull up the properties on first button and give it the label “5” and the ID “MoveUp”
    5. Pull up the properties on second button and give it the label “6” and the ID “MoveDown”

     At this point, you’re thinking “5 and 6???”

    1. Select both buttons (Click the first, and Ctrl+Click the second)
    2. On the Font drop-down on the toolbar, select Marlett. Then take a look at the buttons.

    (Sneaky, huh? Glyphs from this font are used by Windows to render all sorts of UI elements like the Minimize/Maximize Window buttons. This is a handy way to avoid having to use images for simple things like arrows.)

    Now that we have it looking pretty, let’s add the event handlers for the buttons. We’ll build on the logic from this blog entry to figure out which instance of the buttons was clicked.

    1. Pull up the properties on the first button and click Edit Code – paste the following into the editor:

    Sub MoveUp_OnClick(eventObj)

    ' Write your code here


       Dim oItem, oParent, oPrevious


       Set oItem     = eventObj.Source

       Set oParent   = oItem.parentNode

       Set oPrevious = oItem.previousSibling


       If Not ( oPrevious Is Nothing ) Then


              oParent.removeChild oItem


              oParent.insertBefore oItem, oPrevious


       End If


    End Sub

    The logic here is straightforward:

    • Grab the context node of the button (the row of the table, in our case)
    • If there is another item before the context node, remove the context node from the tree and re-insert it before the previous node
    1. Pull up the properties on the second button and click Edit Code – paste the following into the editor:

    Sub MoveDown_OnClick(eventObj)

    ' Write your code here


       Dim oItem, oParent, oNext


       Set oItem   = eventObj.Source

       Set oParent = oItem.parentNode

       Set oNext   = oItem.nextSibling


       If Not ( oNext Is Nothing ) Then


              oParent.removeChild oNext


              oParent.insertBefore oNext, oItem


       End If



    End Sub

    The logic here is similar:

    • Grab the context node of the button (the row of the table, in our case)
    • If there is another node after the context node, remove the it and re-insert it before the context node

    Almost done – let’s just use a little Conditional Formatting to disable the buttons when the item is the first or last in the list:

    1. Add a conditional for the first button which reads:

      if “The expression” “position() = 1” then Disable this control
    2. Add a conditional for the second button which reads:

      if “The expression” “position() = last()” then Disable this control

    Now try it out.

    As an aside, this was the author’s first foray into VBScript. Although I cut my teeth in Applesoft BASIC I’ve done most of my programming in C-style languages (C, C++, C#, Perl, Java). Did I do anything silly?

  • Microsoft InfoPath 2010

    Modifying InfoPath manifest.xsf file from script (5/5)


    Part 5 of 5: The final function


    And the final function is


    function FixupSolutionXSN(








          var XsnInputPath = Combine(inputDirectory, xsnInputName);

          var XsfInputPath = Combine(inputDirectory, "manifest.xsf");

          var XsfOutputPath = Combine(outputDirectory, "manifest.xsf");


          ExtractFilesFromXSN(XsnInputPath, outputDirectory);

          FixupXSF(XsfInputPath, XsfOutputPath, serviceURL, wsdlURL);

          MakeXSNFromFiles(inputDirectory, "manifest.xsf", outputDirectory, xsnOutputName);



    Now the gentle reader has free reins to drive the code above to the helpful utility.


    Converting the script to managed code would be a good exercise as well.



  • Microsoft InfoPath 2010

    Add C# or Visual Basic to your existing form using VSTO

    Have you ever created an InfoPath form to later discover that you have to write code in order to accomplish something you need?
    If so, you have one of two options:
    You can use VSTA to add managed code to your form.  It is included in the Office package, but it is turn off by default.  You must go the Add/Remove Programs and customize Office to install it.
    -- OR --
    You can use VSTO to add managed code to your form which is what this blog entry is about.
    When you create an InfoPath Form Template using Visual Studio 2005, you start with the Design a Form dialog.  On the left you’ll see:
    Choosing one of these options will allow you to create a project using an existing form template.  For example, if you wanted to use a form template from a SharePoint site, you would choose the second option.  You can also choose the last option to import an Excel workbook or a Word document as your form template.
    If you've selected an existing form template, you will get a message:
    If you've selected a form template that already had code behind it, the existing code will be removed from the new form template as well.
    VSTO will now create a project based on the form you've selected and you're ready to add code!
    - Gary
    Software Development Engineer
  • Microsoft InfoPath 2010

    Advanced server-side authentication for data connections, part 2


    In the first part of this series I introduced the concepts involved in three tier authentication. Now let's drill into the details and work with some code.


    Using Office Single Sign-on  with individual mapping

    An Office Single Sign-on (SSO) application definition, can be set up in one of three ways:  individual, group, or group using restricted credentials.  An InfoPath form published to the server can use either of the first two.  However, in order to use individual credentials, the SSO database must contain a separate username and password for each user who connects to the form.  A typical server application would check whether the connecting user had credentials in the database, and redirect to a credentials management page when appropriate to allow the user to enter their credentials.  While InfoPath Forms Services does not do this generically for forms that use SSO, it’s possible to implement a solution for an individual form or a set of forms the same way an Office Server application would, by using the Pluggable SSO API.
    The general approach is to have users link to an ASP.NET page rather than directly to the form.  The ASP.NET page attempts to get the user’s credentials from the SSO database, and based on the result either redirects to the form or to a credential management page  which allows the user to input their credentials.
    Enough talk.  Let’s get our hands dirty.
    My code assumes that you have defined an SSO application definition called MyApp and that the application is set up to use individual credentials.  I also assume that that have an administrator-approved form template called myform.xsn activated on the site collection, and that the form uses one or more data connections that reference the MyApp application.
    In order to use SSO to make the data connection, you must be using data connection settings in a UDC file on the server.  To add the reference to the MyApp app definition, you add an Authentication element to the UDC file.  The authentication element must be the last subelement of the ConnectionInfo element, and it looks like this:
      <udc:SSO AppId="MyApp" CredentialType="NTLM"></udc:SSO>
    To create the redirector page, the first thing is to add a new ASP.NET page to the root site of your SharePoint server.  Find the home directory of your root site by opening up Internet Services Manager and checking the Home Directory page of the properties page for the web application.  Open this web in Visual Studio and add a new ASP.NET page.  In the properties  for the page, enable session state.  Finally, add a reference to the Microsoft.SharePoint.Portal.SingleSignon namespace.
    Once this is done, the new page should look like this:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="SingleSignonRedirector.aspx.cs" Inherits="SingleSignonRedirector" EnableSessionState="True" %>
    <%@ Import Namespace="Microsoft.SharePoint.Portal.SingleSignon" %>
    Open the code file for the page, and add a using statement for the SingleSignon namespace
    using Microsoft.SharePoint.Portal.SingleSignon;
    The code itself is relatively straightforward.  Start by using the pluggable API to get a reference to the installed SSO provider.
    ISsoProvider provider = SsoProviderFactory.GetSsoProvider();
    (this call will fail if no provider is installed, or if the Single Signon service is not running)
    Your page will run under the credentials of the user attempting to access the form, so when you call GetCredentials, SSO will return a credential for that user, or throw SingleSignonCredsNotFoundException if the credential does not exist.
       SsoCredentials credentials = provider.GetCredentials("MyApp");
    catch (SingleSignonCredsNotFoundException)
    In the event that the credentials are not found, you can get the URL of the credentials management page for the installed provider.
    Uri CredentialsManagementUrl = provider.GetCredentialManagementURL("MyApp");
    Now, at this point you could simply redirect to the credentials management URL.  However, you would miss part of the magic of the credentials management page.  The credentials management page supplied with the Office single Sign-on provider will redirect back to the referring page once the user has entered valid credentials.  I chose to handle this by presenting a link to the user to allow them to click through to the credentials management page.
    Response.Write("<P>Before you can access this form, you must enter credentials to access backend data.</P>");
    Response.Write("<P><A href=\"" + CredentialsManagementUrl.ToString() + "\">Click here to enter your credentials</A></P>");
    An alternate approach could be to add the HTTP referer header to the response before performing a redirect.  Either way, once the user has entered their credentials, the redirector page will be called again.  This time the GetCredentials call will succeed, and the page will redirect on to the form.
    Here’s the complete code-behind for the page:
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Microsoft.SharePoint.Portal.SingleSignon;
    public partial class SingleSignonRedirector : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            ISsoProvider provider = SsoProviderFactory.GetSsoProvider();
                SsoCredentials credentials = provider.GetCredentials("MyApp");
            catch (SingleSignonCredsNotFoundException)
                Uri CredentialsManagementUrl = provider.GetCredentialManagementURL("MyApp");
                Response.Write("<P>Before you can access this form, you must enter credentials to access backend data.</P>");
                Response.Write("<P><A href=\"" + CredentialsManagementUrl.ToString() + "\">Click here to enter your credentials</A></P>");
            catch (Exception ex)
                Response.Write("<P>Single Sign-on returned an error:  " + ex.Message + "</P>");
            // Good to go - on to the form
    Response.Redirect( "http://myserver/formservertemplates/myform.xsn?openin=browser" );
    Getting jiggy with it
    For a real-world application, there are a few more things I might do to this page to round out the implementation.  Depending on the needs of the specific application, one or more of the following might apply:
    • Loop through multiple Application IDs to allow the user to enter credentials for each
    • Attempt to log on the user using the SSO credentials to verify that the credentials are valid and have not expired
    • Use this code in a page which hosts the form in question using the XmlformView control
    • Create a generic page which takes the URL to the form and the Application ID as query parameters
    With a little bit of ingenuity, you can use this approach to create a seamless end-to-end experience to satisfy any scenario.
    In my next and final post in this series, I'll talk about how to use a web service proxy for authentication. Stay tuned!
    - Nick
    Program Manager
  • Microsoft InfoPath 2010

    Browser Forms with Spell Check

    With InfoPath Forms Services, you can take powerful InfoPath forms, and allow users to fill them out by using a browser. This enables your forms to reach more customers than ever before. Many Office users have been enjoying the convenience of spell check in Word and InfoPath. To enable this valuable feature for browser forms, we recommend pointing your customers to an Internet Explorer extension called ieSpell. It will check the spelling in your document, just like you would expect it to; you even get to store your personal word list or (clever!) point ieSpell to a Microsoft Office dictionary.
    After filling out a form, hit the ieSpell button and it pops up a dialog, similar to the Microsoft Office spell check. If you want to know the meaning of the word, the thesaurus is just a click away.
    Installing the program is quick and easy. Download from here (free for non-commercial use). When you're done, you will see a new button in the IE toolbar, as well as a new Tools menu item.
    If you are interested to learn more about ieSpell and other browser extensions, take a look at this article from the Internet Explorer team blog.
    Pradeep Rasam
    Program Manager
  • Microsoft InfoPath 2010

    InfoPath Trick to Localize a form in a single view


    TRICK: Localized form in a single view

    Applies to: Microsoft Office InfoPath 2003 SP1

    Need the same form in many languages?  Here’s a trick that’s easier than multiple views.


    By taking advantage of new SP1 features, there’s a simple way to create a multi-language view without duplicating bindings.

    I have used a secondary data source with read-only borderless fields as labels for the view.  This secondary data source is populated by an XML File Data Connection that grabs a file in the LabelsLanguage form library.  This form lib populates a drop-dom, changes of this update the aux-dom and refresh the view.

    There are 2 buttons for adding new languages and editing the current labels of the form.  These pop up a second solution.  To add a new language, just fill out the form and submit.  Look at one of the existing languages for examples.  If you see a typo in your language, feel free to correct it and save.

    To work with button labels, manually update the view using xsl:value-of elements.  Otherwise, use the workaround that I have in the screenshot.

    Known issues:

    • If you update a language on the fly, you need to force IE to always update the cache so you will get the drop-down changes.
    • Some flashing when changing the language.


    Here’s a sample of what it might look like:

    Picture with a language drop down selection 

    Form Code

    public void ChangeLanguage(DataDOMEvent e)
          if (e.IsUndoRedo) return;
          if (e.Operation.ToUpper() == "DELETE") return; //handle double notifications
          // Generate the new file name from the drop-down
          string strFileName = (string)e.NewValue; //from dropdown english.xml
          XMLFileAdapter2 xfaLabels = e.XDocument.DataAdapters["Labels"] as XMLFileAdapter2;
          string strCurrentUrl = xfaLabels.FileURL; //from adapter http://server/site/francais.xml
          string strBaseUrl = strCurrentUrl.Substring(0,strCurrentUrl.LastIndexOf("/")); // http://server/site
          string strCurrentFileName = strCurrentUrl.Substring(strCurrentUrl.LastIndexOf("/")); // francais.xml
          string strNewUrl = strBaseUrl + "/" + strFileName;          // http://server/site/english.xml
          xfaLabels.FileURL = strNewUrl;
          // the drop-down refreshes everything
          (e.XDocument.DataAdapters["Languages"] as SharepointListAdapter).Query();
    public void AddLanguage(DocActionEvent e)
          string strLanguagesFormUrl = "http://your-forms-url/template.xsn";
          (e.XDocument.DataAdapters["Languages"] as SharepointListAdapter).Query();
    public void EditLabels(DocActionEvent e)
          XMLFileAdapter2 xfaLabels = e.XDocument.DataAdapters["Labels"] as XMLFileAdapter2;
          thisApplication.XDocuments.Open(xfaLabels.FileURL, 1);     
  • Microsoft InfoPath 2010

    Using Relative URLs with the ServerInfo Class in InfoPath 2010


    Hi, my name is Jill Anderson and I am a tester on the InfoPath team. In this post, I would like to introduce you to the one of the newest members of the InfoPath Object Model, the "ServerInfo" class.  For InfoPath forms published to a SharePoint server, the members of this class give you context about that particular site. Documentation about this new class can be found at:

    In this short video demo, I show you how you can use the members of this class to enable your form to submit data using a relative URL.  This enables you to package a Site Collection as a WSP and move it to a new server.  With these changes, the submit data connection moves to the new server as well.

    Initial Setup:

    To make sure that my form template was correctly associated with my SharePoint Form Library both before and after the Site Collection Migration, I published it as a Content Type ( ). The ability to publish a Sandboxed Solution as a Content Type is a new feature for Office 2010.

    Afterwards, I associated this content type with the correct SharePoint Form Library on the SharePoint Server. The steps to do this are as follows: 

    1. Create a new "Form Library"
    2. Open the newly created "Form Library"
    3. Open the "Library Settings" located under the "Library" Tab on the Ribbon
    4. Open "Advanced Settings" and set "Allow management of content types?" to "yes".
    5. Under "Content Types" select "Add from existing content types"
    6. Add the content type you published to the SharePoint server.

    Sample Code:

    This is the code I used to relativize the submit to the SharePoint site.

    /// <summary>
            /// Submits the form to the SubmittedTimeCards form library on SharePoint and calls a function to update the Vacation 
            /// and Sick Balance for the employee.
            /// </summary>
            /// <param name="sender">The source of the event.</param>
            /// <param name="e">Provides data for the Microsoft.Office.InfoPath.FormEvents.Loading event.</param>
            public void FormEvents_Submit(object sender, SubmitEventArgs e)
                FileSubmitConnection fileSubmit = (FileSubmitConnection)this.DataConnections["SharePoint Library Submit"];
                // Refreshing the Total number of hours and total pay for this given form.
                // Update the new Sick leave and Vacation Balance.
                // Relative the SharePoint Submit location to current SharePoint site.
                fileSubmit.FolderUrl = this.ServerInfo.SharePointSiteUrl.ToString() + "SubmittedTimeCards/";
                // If the submit operation is successful, set
                e.CancelableArgs.Cancel = false;

    Additional Links

    For more information about creating and publishing Sandboxed Solutions see Phil Newman's post on
    Introduction to Sandboxed Solutions - Sort data in repeating tables using managed code

  • Microsoft InfoPath 2010

    Peer to Peer Solutions using SharePoint Workspace 2010


    In the 2nd of 2 videos about InfoPath 2010 and SharePoint Workspace integration, Shirish Pulikkal from the InfoPath test team shows how to create and maintain an Asset Tracking list for both online and offline use, using InfoPath designer and SharePoint Workspace.

    The Scenario: In the 1st video, Taking a list offline using SharePoint Workspace 2010, Shirish showed how to take a SharePoint Asset Tracking list offline in SharePoint Workspace. Smaller organizations with budget constraints may not have access to a SharePoint Server. In this video we show you how to create and maintain an Asset Tracking list for both online and offline use, using just InfoPath and SharePoint Workspace.

    The Process: We use an Asset Tracking form and Categories form for the demo. Initially the Categories form is imported into SharePoint Workspace and we enable lookup to the list tool containing the Categories form. Next we design a new form for Asset Tracking from within SharePoint Workspace and add a SharePoint Workspace data connection to the Categories form. Then we import the Asset Tracking form in list tool in SharePoint Workspace, publish the tool and make the form available to other users subscribed to the workspace to create new list items. This is an example of a peer to peer scenario. The changes you make in your workspace will be immediately visible to other users subscribed to your workspace.

    Get Microsoft Silverlight
  • Microsoft InfoPath 2010

    InfoPath 2010 Public Beta is Here!


    InfoPath 2010 LogoThe InfoPath team is excited to announce the release of the Office 2010 and SharePoint Server 2010 public betas! For the 1st time members of the public can download InfoPath 2010. Download it now from!

    Here are just some of the highlights in this new release. (For more details, see our earlier What's New in InfoPath 2010 post).

    Quick and Easy Form Design

    • Designing good looking forms has been made easier with our new page layout templates, layout tables, and themes.
    • With our new out-of-the-box rules and improved rules management UI, you can easily add rules to validate data, format your form, or perform other actions with just a couple of clicks, and without any code. 
    • Our new “quick” publish functionality allows you to publish forms in a single click (no more clicking through the Publishing Wizard every time you want to make an update to your forms!)
    • New Controls include the picture button, signature line control and person/group picker which is now available out-of-the-box in the controls gallery.

    SharePoint Integration
    Over the past 3 years of product development, we’ve made huge investments in integration with the SharePoint platform to make it much easier to build rich forms-based applications on top of SharePoint Server 2010.

    • Using InfoPath, you can now extend and enhance the forms used for creating, editing and viewing items in a SharePoint list.
    • With the new InfoPath Form Web Part, you can host your forms on portal pages without writing a single line of code. 
    • With SharePoint sandboxed solutions, forms with code can be published directly to SharePoint libraries without requiring administratror approval.
    • Richer browser forms:Bulleted, numbered, and plain lists, multiple selection list boxes, Combo boxes, Choice group and sections, and Filtering functionality are now supported in browser forms.
    • InfoPath Forms Services Administration and Management: We have invested in many improvements to make it easier to manage InfoPath Forms Services as a component of Microsoft SharePoint Server 2010. These include Powershell commandlets to automate tasks and SharePoint Maintenance Manager Rules to monitor the health of your server.

    New iconIntroduced since the technical preview, InfoPath now supports connecting to REST Web Services.

    Go download the beta now and send us your feedback using Send-a-Smile.


    The InfoPath Team

  • Microsoft InfoPath 2010

    InfoPath 2010 is unveiled at the SharePoint Conference


    As many of you may know, the SharePoint Conference 2009 is taking place this week in Las Vegas, Nevada and it's been a particularly exciting week for the InfoPath product team. Over the past 3 years of product development, we have made huge investments in integrating with the SharePoint platform. Finally, this week, we got the opportunity to unveil the fruits of these investments to the world, and so far, the reception has been tremendously positive! (Check out what people are saying about InfoPath 2010 on Twitter.)

    SPC is taking place at the Mandalay Bay Hotel:

    SPC 2009 - Mandalay Bay Hotel

    InfoPath Booth:

    (from left: Umut Alev - development lead, Peter Allenspach - group program manager, Rick Severson - test lead):

    SharePoint Conference - InfoPath Team Members

    InfoPath 2010 is well represented at this year's conference with a total of 5 sessions. The 1st session took place on Monday and was presented by Peter Allenspach and Bojana Duke from the InfoPath program management team.

    The InfoPath session drew big crowds:

    SPC 2009 - InfoPath Session Audience

    The session opened with an introduction to InfoPath 2010, followed by 3 feature demos which illustrated just how easy InfoPath 2010 makes it for Information Workers to create their own solutions without reliance on IT departments. Some highlights below -

    InfoPath 2010 Overview:

    InfoPath 2010 Overview

    Demo 1: Customizing a SharePoint list form

    In this demo, Peter and Bojana walked through a real Microsoft internal College Recruiting scenario. Employees use SharePoint lists to sign up for recruiting trips. Bojana wowed the audience by taking the Recruitment Trip list form and customizing it in InfoPath in under a minute!

    Peter and Bojana then went on to show how this form could be further enhanced and customized. Our new out of the box rules were used to add data validation and to conditionally show or hide sections in the form. A data connection to the Colleges list was added to pull details about the colleges into the recruiting trip sign-up form. The form layout was customized using our new pre-built layout tables and themes. They then showed how in a single click, the form could be published to SharePoint. Not only that, but they then showed how the list, including the customized form could be taken offline in SharePoint Workspace.

    Last but not least, they opened the form in Firefox showing that you can use your browser of choice to fill out your forms.

    Before Form:

    SharePoint List - Default Form

    After Form:

    SharePoint List - Customized InfoPath Form

    Offline Form in SharePoint Workspace:

    SharePoint WorkSpace - Offline Form

    Demo 2: Creating Mashups using the InfoPath Form Web Part
    The 2nd demo took the Recruiting scenario to the next level. In this demo, Bojana created a simple portal page with 2 Web Parts, the Recruiting trip list and the new InfoPath Form Web Part. In only a few clicks, she connected the 2 Web Parts. Now when she selected an item in the recruitment list, the details for that trip were displayed in an InfoPath form.

    Portal Page:

    InfoPath Form Web Part

    They concluded the 2nd demo by showing that both SharePoint solutions and InfoPath forms are truly portable and reusable. The site was saved as a template (WSP) and a new site was created from this template. The SharePoint list, portal page and InfoPath form were fully functional on this new site.

    Demo 3: Office Business Applications: Procurement scenario
    In this final demo,  Peter and Bojana showed the audience how InfoPath helps IT departments develop full Office Business Applications on the SharePoint platform. They used a procurement scenario to demo these capabilities. In this scenario, an employee submits a request to purchase a new laptop computer. The solution used an InfoPath form that connects to a vendor database, that brings in details about the goods you can purchase.

    Procurement Form:

    Procurement Form

    This type of application can be built in SharePoint Designer, using web part pages to create the user experience. The data can be stored in form libraries, SharePoint lists, and external systems using Business Connectivity Services. If InfoPath rules don’t do the job of defining the desired form behavior sandboxed or full trust code can be added to the forms. SharePoint workflows can be used to send e-mail notifications and track status. And once you’re all done, you can package your application so it can be tested and eventually deployed to the production servers.

    Procurement Portal Page:

    Procurement Portal Page 

    This first session set the stage for the remaining InfoPath sessions of the week:

    • Building Applications with InfoPath and SharePoint Designer (this session took place on Tuesday - more details to follow)
    • Performance Best Practices for Forms Applications
    • InfoPath 2010: Form Design Best Practices
    • Form-Driven Mashups using InfoPath and Forms Services 2010

    Stay tuned for more updates from Las Vegas!

  • Microsoft InfoPath 2010

    InfoPath-Related Blogs: OPML Compilation


    We promised, and here it is: the OPML compilation of RSS feeds of bloggers that write about InfoPath. Just download the file and import it into your favorite news aggregator.

    Sneak peek:


  • Microsoft InfoPath 2010

    Complex Data Validation

    How do you test more than 5 parameters? How do you group parameters? One answer to both questions, is to have multiple validations in one statement. We'll look into these problems in detail in the case studies below.

    Case Study #1

    Problem: a form designer wants to use this logic:

    IF (State="Ohio" or State="Alabama" or State="Arizona" or State="Georgia" or State="Utah" or State="Idaho" or State="Iowa") THEN (fail...)

    Since the Validation UI only supports 5 statements, you run out of room before entering all of the tests.

    Solution: Put more than one test in a statement. If you aren't sure of the syntax, follow along.

    Enter the first three tests.

    Click [OK] to close the dialog. Notice that the syntax is displayed in this dialog:

    Click [Modify] and use this syntax.

    When you change the first column to "The expression", you will see how to refer to the field you are checking. This differs depending on if you are checking the current field or a different field. In this case, State is the selected field, so we can enter the validation like this:

    If you OK this and then come back to it, InfoPath will automatically break out the last 4 tests into separate statements. This makes it easier to see more of the conditions that are being evaluated.


    Case Study #2

    Problem: a form designer wants to use this logic:

    IF (State="Ohio" or State="Alabama") and TaxRate is blank THEN (fail...)

    Using just the default Validation UI, you can't group tests like this.

    Solution:  Put more than one test in a statement. Again, if you aren't certain of the syntax, enter the tests in the Validation dialog:

    Click [OK] to close. Note the syntax in this dialog:

    Click [Modify], and use the syntax shown in the Validation statements.


    Alternative Approach

    Another way to handle both of these scenarios is to use multiple validations:

    This will work and in some cases would be easier to follow (the 50 states could be listed and you could scroll the Validations).

    Performance may be better in one or the other, but that would depend on the logic you are validating.

    All of these statements are evaluated. There is not an implied "and" or "or" combining them. In this last example, if you were checking the "State = ...  OR TaxRate is blank", both would fail. You could check the number of errors and would get 2, even though only 1 error message would be shown (the first one).

    Jerry Thomas
    Software Design Engineer in Test

  • Microsoft InfoPath 2010

    IE7 is here


    Our friends from the Internet Explorer team are celebrating a major milestone - the release of Internet Explorer 7. You all know about the great features it brings to browser users (security, performance, ease of use); you may have seen them first-hand by trying out their Release Candidates.

    You may be wondering - how does this affect InfoPath? From the first look, there shouldn't be much connection, but there is.

    InfoPath ‘s editing surface is built on top of Internet Explorer. This means that most things that you see when you fill out an InfoPath form are, really, just clever HTML elements. Internet Explorer 7 brings improved implementations - thus, InfoPath users will benefit from the IE7 install, too.

    Some specifics:

    • IE7 provides a windowless SELECT control, which brings better performance for InfoPath forms that use the Drop Down List Box, List Box, or Combo Box controls .
    • IE7 offers full type-ahead support for dropdowns: for example, if a dropdown contains {"apple", "banana", "orange"}, then typing "ba" with the focus on the control will take you to "banana". InfoPath inherits this perk.
    • Overall rendering performance is improved
    • Many InfoPath crashes are fixed

    This list is relevant for InfoPath 2007. InfoPath Forms Services will benefit just like any other web app.

    Bottom line: if your organization uses InfoPath, the returns on deployment of Internet Explorer 7 will be even greater! IE7 will be distributed as a public update; if you can't wait (and I personally couldn't - I downloaded the final release of IE7 the minute I found out it was available), get it here.

    Alex Weinstein
    Program Manager

  • Microsoft InfoPath 2010

    Hosting InfoPath forms in a custom ASPX page


    Many of you saw a detailed MSDN article on embedding an InfoPath XmlFormView control into a custom ASP.NET page. But - there's more to it. I came across an interesting blog post that talks about embedding a browser-based InfoPath form into a webpart. Here's another post of someone who got it to work, with nice screenshots.

    Alex Weinstein
    Program Manager

  • Microsoft InfoPath 2010

    Debugging Browser Forms


    Debugging InfoPath forms in the client environment is relatively simple: set a breakpoint, press F5 and execute the process that will cause the breakpoint to be hit. However, debugging InfoPath forms that are opened in the browser requires some additional steps:

    1) Ensure the InfoPath Form Template is compiled in the Debug Configuration so the XSN includes the symbol (PDB) file
    2) Open the local copy of the code file in Visual Studio and set a breakpoint
    3) Attach to the appropriate w3wp process
    4) Execute the process that will cause the breakpoint to be hit

    So let’s take a look at each step individually.

    Step 1: Ensure the InfoPath Form Template is compiled in the Debug Configuration so the XSN includes the symbol (PDB) file

    1) Open the InfoPath Form Template in Design View
    2) Open the Code Editor
    3) From the Project menu choose “<ProjectName> Properties”
    4) Insure the Configuration option is set to Active (Debug)

    NOTE: If you do not see the Configuration option make sure the “Show Advanced Build Configurations” option is enabled: Tools | Options | Projects and Solutions | General

    5) Build and save the project
    6) Publish the Form Template to your Microsoft Office SharePoint Server

    NOTE: If you want to make sure the XSN you are publishing includes the symbol (pdb) file, save the XSN as Source Files and review the resulting files to make sure there is the .pdb file.

    Step 2: Open the local copy of the code file in Visual Studio

    1) Launch Visual Studio 2005
    2) Open the code file (i.e. FormCode.cs) from the project files folder for your Form Template
    3) Set a breakpoint

    Step 3: Attach to the appropriate w3wp process

    1) Open Internet Explorer and navigate to your site
    2) From the Debug menu in Visual Studio choose “Attach to Process…”
    3) For the “Attach To” option make sure this has at least “Managed code” – if not, click the Select button to enable Managed Code
    4) Select the correct w3wp process and click Attach

    NOTE: Determining the correct w3wp process can be a bit tricky. To isolate the correct process:
    - From the server machine, open a command prompt
    - Navigate to the System32 directory and run the following script: iisapp.vbs. This script will list all the currently running w3wp.exe processes, listing their PID and associated application pool id. The application pool id is the only relation between the pid and your application.
    - Use the PID to identify the correct w3wp.exe on the “Attach to Process” screen.

    Step 4: Execute the process that will cause the breakpoint to be hit

    1) Open your form in the browser and execute the process that will cause the code to run – execution should stop when it hits your breakpoint!

    Scott Heim
    Support Engineer

Page 6 of 12 (298 items) «45678»