Microsoft InfoPath 2010
The official blog of the Microsoft InfoPath team

  • Microsoft InfoPath 2010

    Associating a Custom Document Information Panel with an Office Document


    When a custom Document Information Panel is associated with an Office document and/or template, the information needed to locate the Panel is contained in a custom XML data part stored with the document.
    I won’t go into the details of the way an Office Open XML document is structured here (needless to say there are many great resources for this on the web), but the format is basically a ZIP file with a collection of XML files that describe the contents of the word processing, spreadsheet, or presentation. Those XML files are linked to each other via logical “relationships” that define the necessary semantics (e.g. that one file contains the content for the header).

    In the terms familiar to the Office Open specification, a custom XML data part is stored at the following location in an Office Open XML document:

    Basically, the data is stored in an XML file which is logically related to the main part for that file type, and whose logical relationship is of type “customXml”.
    Now then, the other half of the definition of a custom Document Information Panel is the content of that custom XML data part. Here’s an example of the data stored in the custom XML data part for a custom Document Information Panel:

    <customPropertyEditors xmlns="">

    This part defines the settings for the Document Information Panel by using the following four elements:

    Element Name Definition
    showOnOpen This element specifies whether the Document Information Panel should automatically be displayed when the document is opened and the first time it is saved.
    defaultPropertyEditor This element specifies which Document Information Panel template should be shown first when the Panel is made visible (either automatically or by the user).

    The contents of this element are one of two choices:
    Standard properties – this setting shows the default Office 2007 property template
    <custom XML namespace> - if the template to be shown should be a custom Document Information Panel stored with the document, its root XML namespace is stored in this element, so Office can locate and display this information automatically when the Document Information Panel is shown

    XMLNamespace The root XML namespace of the custom Document Information Panel. If this template is the one which should be shown automatically, this value is the same as the value of the defaultPropertyEditor element.
    XSNLocation The location of the InfoPath form template to be shown in the Document Information Panel. This location can be of either of the following forms:
    • File path to the InfoPath form template.
    • The URN of the form template if it is a template installed on the target computer.

    With that information defined, Office automatically locates a custom Document Information Panel and displays it as requested. Note that none of these steps involve using Office to set up the Document Information Panel – this process can be automated without Office (for example, to add a Document Information Panel to a template as part of a server-based process).

    Alnur Ali
    Program Manager

  • Microsoft InfoPath 2010

    How to Enqueue Submits While Offline


    How to Enqueue Submits While Offline

    Applies to: Microsoft Office InfoPath 2003 SP1


    User fills out forms for a particular form template while the laptop is disconnected from the network.  Upon reconnection, seamlessly syncrhonize the offline forms to a Windows SharePoint Services form library. 


    Using OnSubmitRequest, you can have the code save to the offline folder depending on if we're offline or not, as in the following code, which is written in C# using our Visual Studio .NET Toolkit.  You will also need to add a project reference to System.Xml.dll and the using System.XML; directive to your form code.

      public void OnSubmitRequest(DocReturnEvent e)

        if (thisApplication.MachineOnlineState == XdMachineOnlineState.Online)
         // submit to Sharepoint using DAVAdapter
         (thisXDocument.DataAdapters["Submit to Sharepoint"] as DAVAdapter).Submit();
         // We are offline or working offline.
         XmlDocument oDOM = new XmlDocument();
         Microsoft.Office.Interop.InfoPath.SemiTrust.IXMLDOMDocument oWrappedDOM = thisXDocument.DOM;
         oDOM.PreserveWhitespace = true;
                + DateTime.Now.ToString("") + ".xml");
        e.ReturnStatus = true;

    Then, if you've been offline for a while and a number of files have built up, you can run the following jscript to invoke InfoPath externally and force a submit looping through the files, as below:

    var oFileSys = new ActiveXObject("Scripting.FileSystemObject");
    var oSubmitDir = oFileSys.GetFolder("C:\\Submit");
    var oFilesInSubmitDir = new Enumerator(oSubmitDir.Files);
    var oApp = new ActiveXObject("InfoPath.Application");
    var fso = new ActiveXObject("Scripting.FileSystemObject");
    for (; !oFilesInSubmitDir.atEnd(); oFilesInSubmitDir.moveNext())
     var strFileName = oFilesInSubmitDir.item().Name.toLowerCase();
     if (strFileName.length >= 4
         && strFileName.lastIndexOf(".xml") == (strFileName.length - 4))
       var oDoc = oApp.XDocuments.Open(oFilesInSubmitDir.item().Path);
       var f = fso.GetFile(oFilesInSubmitDir.item().Path);
      catch (e)
       WScript.echo("ERROR: " + e.description);
  • Microsoft InfoPath 2010

    Install the Office 2010 Technical Preview and win an Xbox 360 Elite!


    We on the InfoPath team are delighted to announce the release of Microsoft InfoPath 2010 (Technical Preview). We’re really excited to share all of our great new features with you!

    (Click the thumbnails for higher-resolution images.)

    InfoPath 2010

    InfoPath Desiger 2010


    • Use InfoPath to customize SharePoint list forms
    • Design forms more quickly and easily with page and section layouts, themes, and Fluent user interface.
    • Add smarts to your forms with pre-built rules
    • Publish your forms with one-click

    Where do I sign up?
    The Office 2010 Technical Preview is a limited-availability release.  To sign up to be considered for the Office 2010 Technical Preview program:

    How do I win the Xbox? 

    • Build a real-world end to end application using InfoPath 2010 and Microsoft SharePoint Server 2010.
    • Download the Community Clips Recorder from 
    • Record a walkthrough of your solution, showing us how you used InfoPath forms and other Office technologies (5 minutes maximum)
    • Submit the finished video to us

    Contest is limited to eligible members of the InfoPath 2010 Technical Preview program referenced above, and additional limitations may apply.  All submissions will be reviewed by the InfoPath team, and prizes will be awarded in several categories, including best overall solution, best video, and best bug.  Contest details will be posted on the technical preview site at

    We will post more details on our new features in the coming weeks. Stay tuned!

  • Microsoft InfoPath 2010

    InfoPath Quick Tip: Setting a User Role as the Initiator


    In Microsoft Office InfoPath 2003, you can assign users to distinct categories, called user roles, which are based on job title or other criterion. InfoPath can perform custom actions that vary based on the current user role, such as switching views, conditional formatting, data validation, or filter settings.

    Some InfoPath form designers have found the Set as initiator option for user roles to be somewhat confusing when specifying a role using network accounts. (The Set as initiator option is available when defining a user role by clicking User Roles on the Tools menu, and then clicking Add). Setting a user role as the initiator will cause InfoPath to use that role whenever a new blank form is opened for the first time regardless of how the user is logged on to the network. However, the next time that user opens the same form, InfoPath will use the person's assigned user role instead of the initiator role

    For example, suppose you create a form template with an Employee View and a Manager View and then create a rule to switch views based on whether the current user role is Employee or Manager as demonstrated in Lab 7: User Roles in InfoPath 2003. Because the Employee role is set as the initiator, when a user creates new blank form, InfoPath will always set the user role to Employee even if the current user is not a member of the network group or user accounts specified for the Employee user role. As a result, InfoPath will always switch to the Employee View the first time a user creates a new blank form. Only after the form is saved and re-opened will the rule be applied based on the user role defined for the user's network account.

  • Microsoft InfoPath 2010

    Create Code-Free Mashups with InfoPath and SharePoint Web Parts


    Hi, My name is Nicholas Lovell and I’m a developer on the InfoPath team. In this video demo, I will walk through how to create a simple portal page for processing claims at an insurance company. This claims portal includes a SharePoint Web Part with a list of all the claims, an InfoPath Web Part that displays the claim details, and a custom Bing Maps Web part which displays the location of the currently selected claim.

    Get Microsoft Silverlight

    Enjoy and please share your comments with us!


  • Microsoft InfoPath 2010

    Download the Beta!

    I'm super excited to announce Microsoft Office InfoPath 2007 Beta and Microsoft Office Forms Server 2007 Beta for browser-enabled forms, so you can install both of them today.
    After registering you'll get to select which products you want, which should include:
    • Microsoft® Office Professional Plus 2007 (includes InfoPath)
    • Microsoft® Office SharePoint® Server 2007 - Enterprise (includes Forms Services, which is also available standalone as Microsoft® Office Forms Server 2007. Both servers have 64-bit options.)
    All are available in English, French, Spanish, German, and Japanese, so tell your friends!
    - Ned and the whole exuberant InfoPath team
  • Microsoft InfoPath 2010

    Protecting Sensitive Data

    Frequently, we find developers using InfoPath as a platform for developing solutions that manipulate sensitive data, may it be financial data, patient records, or performance review forms. This article shares tips on protecting such data.
    First and foremost, you must know that an InfoPath form is a plain-text XML file. A malicious user can read it through Notepad or other text editor, circumventing any InfoPath authentication logic. So if a user has read access to an InfoPath XML form, anything stored in that XML file can be read. Information Rights Management in InfoPath 2007 allows storing encrypted XML; we'll talk more about it below.
    Also remember that an InfoPath form template (.xsn file) is just a CAB archive, containing plain-text files. These files store all client-side form logic. Information Rights Management allows you to encrypt form templates in InfoPath 2007, see more about it below.
    Like with any other client-server application development platform, you can never trust the logic that happens on the client. InfoPath uses the form template to store all form logic; if the user has access to the form template (and they must in order to be able to open any form based on that form template), they can create a hacked version of the template, circumventing any restrictions that the original form author put in place.
    This means that authentication and authorization performed on the client can't be trusted; calculations and data validation have to be re-done on the server. Here is an example of how this strategy can be realized for a simple record-keeping application:
    • Do not store sensitive data in the XML file; instead, store keys in the XML file, and perform queries on load that populate the rest of the data by using a database/web service. If the user is unauthorized (as determined by the server-side logic), return an empty dataset. You can even detect such condition on the client and show a friendly error message.
    • On submit, send the data to a web service and redo all non-schema validations on the server side. For example, if employees should not be able to submit expense reports above $100 without specifying an approver, have your web service process the dataset and verify that this condition is satisfied. 
    It is always a good idea to restrict access to a production form template by assigning read-only permissions to form users, write access to form maintenance staff, and no access to everyone else. This can be done by using permission features of the SharePoint Server or file shares. Even if you install form templates to the users' machines via a logon script, you can still control access to the .xsn file - provided the user is not running as an administrator, you can set their access to the template file to read-only.
    You may want to enable the protection feature for production form templates:
    However, remember that this protection feature is for recommendations only, it is not intended as a security mechanism. This will show the user a nice error message if they accidentally try to open the template in the Design mode, but won't defend the form template against a malicious user.
    Information Rights Management, or IRM, is a new feature for InfoPath 2007; some of you may already be familiar with the concepts from the other apps in the Office 2003 release. IRM allows the form author to protect both the form template and forms based on the template; IRM infrastructure must be in place in the organization to make this possible. Briefly, IRM is a way to encrypt both form templates and forms, allowing form author to specify who can access the template and suggest default rights for forms based on the template:
    Note that IRM is an InfoPath client-only feature, and it will not work in browser-enabled form templates.
    Alex Weinstein
    Program Manager
  • 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

    Designing browser-enabled forms for performance in InfoPath Forms Services (Part 5)


    Part 5 – Addendum: Counters for monitoring form server performance

    Welcome to the fifth article in our series on optimizing the performance of InfoPath browser-enabled forms. In our previous articles we defined performance in terms of responsiveness, listed a number of conditions that cause postbacks, and looked at some of conditions that make postbacks more expensive, reducing the responsiveness and scalability of a form system. We also described some of the issues that affect form-rendering performance in the browser and suggested using the Design Checker to monitor browser compatibility issues while designing a form template in the InfoPath Designer.

    In this addendum article, we list some useful performance counters you can use in the Windows Performance Monitor (PerfMon) to monitor the behavior of your form server system. Using a combination of general system counters and InfoPath-specific counters to monitor the performance of your servers can help you troubleshoot issues and quantify the performance effects of changes you make to the design of your InfoPath form templates.

    System counters for monitoring your form server system

    There are two key places where performance bottlenecks can occur in your form server system, on your Web front end (WFE) servers and on your SQL Server back end. The bottlenecks that occur on the front end are normally CPU bound, while the bottlenecks at the SQL Server back end are normally either disk bound or CPU bound.

    You can use the following system counters in PerfMon to check the performance of your WFE and SQL Server systems under various load conditions. Use these counters to determine whether your servers are performing at acceptable levels and to help identify any bottlenecks.

    Counters for monitoring a WFE server system

    • CPU:
      Processor\% Processor Time\_Total
      Indicates the total CPU load on the server.

    • ASP.NET:
      ASP.NET \Requests Queued
      A linear increase of this counter with user load can indicate that an application is experiencing a bottleneck, either at the front end or the back end. Correlate with other ASP.NET counters, SQL counters, and WFE CPU counter to understand which part of the system is getting bottlenecked.

      ASP.NET\Requests Execution Time
      Use this counter to find which type of form template takes more time to execute in the server. In general, forms with managed code require more execution time than forms that don’t. If this counter and WFE CPU counter are high while the SQL transactions/second counter and SQL CPU counter are low, then the bottleneck is at the WFE side. This may be an indication that the form complexity is high or that the form has a lot of managed code.

    • Memory:
      No. of current logical threads
      If the count is increasing, then the thread stacks are leaking.

      Private bytes and No. of bytes in all heaps
      If the count of private bytes is increasing while the number of bytes in all heap counter is stable, then the unmanaged memory is leaking.
      If the count of private bytes is increasing and the number of bytes in all heap counter is also increasing, then the managed heap is building up.

    Counters for monitoring a SQL Server system

    • CPU:
      Processor\% Processor Time\_Total
      Values above 25% indicate a possible bottleneck. Values above 80% signify extreme CPU-bound SQL operations. A linear increase in CPU with user load indicates that SQL will become a bottleneck.

    • Disk:
      Counter should be less than 1.5 or 2 times the number of RAID disks. Correlate with % Disk time counter and Current Disk Queue counter to determine whether the disk is a bottleneck. Decrease your test load to see if the values go down.

      SQLServer:Locks\Number of Deadlocks/sec\_Total
      Value should be zero.

    • Memory:
      Non-zero value for a sustained period of time indicates that the system is experiencing a high memory load. SQL Server works best when the operating system does not reallocate its memory.

    Counters provided by the InfoPath Forms Services performance object

    InfoPath Forms Services installs a set of counters that can be viewed in PerfMon. There four types of counters provided by the InfoPath Forms Services performance object: Transaction, Session, Data Connection, and Template/Document.

    • Transaction counters represent all communication between the browser and the server. You can use the transaction counters to monitor how long postbacks are taking to complete and as a gauge for how expensive they are for the server to process.

      Avg. Transaction Duration
      The average time to complete a transaction in form-filling sessions.

      Transactions Started Rate
      The rate at which transactions started in form-filling sessions.

      Transactions Completed Rate
      The rate at which transactions completed in form-filling sessions.

    • Session counters provide duration and rate information for user form-filling sessions. If there are too many active sessions for the server to handle, you will see excessive average durations that indicate a server bottleneck.

      Avg. Session Duration
      The average time to complete a form-filling session, summed up over all transactions in the form-filling session.

      Sessions Started Rate
      The rate at which form-filling sessions started.

      Sessions Completed Rate
      The rate at which form-filling sessions completed.

    • Data Connection counters show the duration and rate of both data connection submit and query activities, along with failures. This will give you an indication of back end performance and how long data connections are taking to complete.

      Avg. Data Connection Submit Duration
      The average time to complete a data connection submit in form-filling sessions.

      Data Connection Submit Started Rate
      The rate at which data connection submits started in form-filling sessions.

      Data Connection Submit Completed Rate
      The rate at which data connection submits completed in form-filling sessions.

      Data Connection Submit Failure Rate
      The rate of failures for data connection submits in form-filling sessions.

      Avg. Data Connection Query Duration
      The average time to complete a data connection query in form-filling sessions.

      Data Connection Query Started Rate
      The rate at which data connection queries started in form-filling sessions.

      Data Connection Query Completed Rate
      The rate at which data connection queries completed in form-filling sessions.

      Data Connection Query Failure Rate
      The rate of failures for data connection queries in form-filling sessions.

    • Template/Document counters give information about the number of forms and form templates that are currently in the ASP.Net cache and in memory. These can help you monitor and detect memory utilization issues on your server.

      # of Cached Form Templates
      The number of form templates that have been added to, and not yet expired out of, the ASP.NET object cache.

      # of Business Logic Assemblies in Memory
      The number of business logic assemblies currently loaded in memory. Administrator-approved form templates may contain zero, one, or more managed code assemblies.

      # of Form Templates in Memory
      The number of form template objects that are currently loaded in memory.

      # of Cached Form Templates in Memory
      The number of forms that are currently loaded in memory.

    Server system health monitoring

    The general system counters and InfoPath Forms Services counters listed above are useful for monitoring specific issues on a server, but do not provide comprehensive health monitoring for your overall form server system. For that you need to use a solution designed to watch multiple servers for issues that may cause service or performance degradation, such as Microsoft System Center Operations Manager 2007. Operations Manager uses management packs that contain predefined rules, settings, and agents to monitor a specific service or application. For SharePoint, you can download the SharePoint Monitoring Toolkit, which contains the management packs and documentation for both Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007. Note that System Center Operations Manager also provides the capability to customize existing rules or create your own rules.

    For more information about the SharePoint management packs for Operations Manager 2007, see the SharePoint Monitoring Toolkit Executive Overview (

    For more information about Microsoft System Center Operations Manager 2007, see the System Center Operations Manager TechCenter (


  • Microsoft InfoPath 2010

    InfoPath 2010: Menu to ribbon reference workbook


    Find the new locations of InfoPath 2007 commands in InfoPath 2010. The InfoPath 2010 menu to ribbon reference workbook contains tables that list the old menu commands and show where in InfoPath 2010 those commands are located.

    This Excel workbook is now available to download from

  • Microsoft InfoPath 2010

    Implementing Change Tracking for InfoPath Forms


    Although InfoPath doesn't have a Change Tracking feature built-in like Word and some of the other Office System applications, read on for guidance on how to implement it in your own solutions.

    There are several problems to decide before jumping into implementation: where do you want to store change tracking information, how do you map between list of changes and elements, tracking information protection, and what format you use to store change tracking information.

    Storage options

    Depending on schema of XML there are several options:

    1.  Closed schema - public or required by third party.
      1. "Envelope" approach - you can store whole document as XML sub tree inside your own XML with open schema.
      2. Using Processing Instructions to store data is possible when the schema allows it and consumers of XML can handle processing instructions correctly. Note that even if one suppose to ignore them it is not always the case.
      3. Separate file. Just keep tracking information somewhere (I.e. local file or remote Web service). This approach is remotely reasonable if you know how to associate data with tracking information.
    2. Open schema
      • Store tracking information as single attribute.
      • Store tracking information as sub-tree of each element that is interesting for change tracking
      • Store tracking information in single node providing some mapping between elements you are interested in and tracking information.

    Format options

     1. XML friendly.

    If you want your tracking information to be processed using some form of normal XML handling (XSL, XML readers, XPath navigation) then you should use XML sub-trees to store change tracking information.

    For example:

      <change forElement="element1233" date="2004-06-12" author="john" type="textChange">New text</change>
      <change forElement="element1233" date="2004-06-14" author="fred" type="textChange">Don't writen new text!</change>

     2. Custom text format

     If you can't use normal XML for some reasons (i.e. storage options 1.b, 2.a) then you can develop text format to store the data. You can use approach close to XML (i.e. just store sub-tree as string) or even go with Base64 encoded binary.

    Mapping between element and tracking information

     1. Direct access.

     If you can put tracing information right into element you are interested in then you don't need any mapping.

     Note that this approach requires you to think through deletion scenario because the element itself might be deleted along with it's tracking information.

     2. Element ID. 

    This is an easy option to implement if you have or can establish persistent unique element identifiers for each element you want to track changes. It could be attribute on elements or some combination of attributes and values of element.

    Note that you can not use XPath to element as unique id if you have any repeating content you want to track changes on.

    The problem here is that you need to have good ID and should think through insertion of elements.

    3. Position based mapping.

    This is the most complex option to implement. If you can't have any identifiers for element you had to go with position based mapping. I.e. 

    <change forElement="/root/items[0]/item[4]/component[3]" date="2004-06-12" author="john" type="textChange">New text</change>

    where forElement contains the XPath to the element of interest.

    The main problem here is that you have to dynamically update all mappings on element insertions through the tree.

    Change tracking information protection

    You should consider if and how you want to protect this data. Approaches would vary from digitally signing each change (or editing session) to "who cares if it is changed?"

    Coding ideas for simplest case

    You have unique element IDs that somehow get generated for elements. You are interested in recording changes in text value of an element.

    Here is sample of XML you want to record changes for:

      <item id = "12"><textToTrack>text</textToTrack></item>
      <item id = "23"><textToTrack>text</textToTrack></item>
      <item id = "55"><textToTrack>text</textToTrack></item>

    The approach choosen to store the data: separate from the data as subtree of the <root> node, and no protection and tamper detection for tracking information.

    Here is example of XML with tracking information.

      <change forElement="12" date="2004-06-12" author="john" type="textChange" ><old>text</old><new>Shining new text</new></change>
      <change forElement="12" date="2004-06-14" author="fred" type="textChange" ><old>Shining new text</old><new>Don't write new text!</new></change>
      <change forElement="23" date="2004-06-14" author="fred" type="delete"></change>
      <item id="12"><textToTrack>Don't write new text!</textToTrack></item>
      <item id="55"><textToTrack>text</textToTrack></item>

    To code this in InfoPath you need:

    Make sure schema allows <changes> to be inserted. I.e. In designer for new solution create this structure in the Data Source task pane.

    Figure out how to get user name if needed.

    Add an "OnAfterChange" listener for <items> node, and implement the following pseudo-code:

     IF change = "add" AND node-name = "item"
      make sure ID is generated for "add"
      record (ID, added) information.
     IF change = "remove" AND node-name = "item"
      record  (ID, deleted)
     IF (change = "add OR change = "remove" OR change = "change") AND node-name = "textToTrack"
      record (ID, textChange, oldValue, newValue)

    Where ID is "id" attribute of corresponding "item" node, and record means append all needed information a <changes> collection. Record function should also take care of merging change information for the same date/user like if node was added in this session all changes should be combined into "added" record, rather then creating multiple "changed" sections.

    Note that "undo" user actions will rollback change as well as tracking information. If you store data in separate file you should take care of undo yourself.


  • Microsoft InfoPath 2010

    Hiding hint text when conditionally hiding a repeating or optional control


    Certain controls, such as repeating and optional sections and repeating tables, will display a link that, when clicked, will insert a new item into the form. By default, the text of this link, which is called hint text, is “Insert item” for repeating controls and “Click here to insert” for optional sections.  This text can be customized or turned off completely through each of these control’s property dialogs.

    In addition, the InfoPath Designer enables you to specify conditional formatting for these controls.  One of the actions that you can perform is to hide the control based on some condition.  When that condition is true, the control is hidden.  However, when the control is hidden, the hint text remains visible. This is often perceived as a bug in InfoPath but is actually by-design.

    The reason behind this is simple and makes complete sense once you understand it.  Very simply put, each of the repeating controls allows you to set conditional formatting on a per-row basis.  This means that you can specify a condition that will hide a specific row and not the entire repeating table or all instances of the repeating section.

    However, sometimes, especially in the case of optional sections, you wish to hide the entire control instead of just a single row.  The workaround for this is to put the control inside a section.  Then, set the condition which will hide the control on the section itself.  This will hide the section and all controls within it.


  • Microsoft InfoPath 2010

    Cool Forms! Team Status Tracking Form


    This week’s cool InfoPath form is a form used by one of the teams at Microsoft to track their status. It uses conditional formatting for color coding the status to make it easy to see progress at a glance. By recording team status on their SharePoint site, everyone knows how the team is doing and where they need to focus their energy. As new milestones are added to the project, they are added to the form.

    Team Status

    If you have a “cool” form that you would like to share with us, please send an e-mail with the following details to -

    • Attach 1 or 2 screenshots of your form
    • Provide a brief description of the form
    • You may also attach the XSN file (optional)

    The most popular submissions will be featured on our blog in future posts.

    Check out other Cool Forms! here


    The InfoPath Team

  • Microsoft InfoPath 2010

    Example script for showing Mail Envelope based on User’s Role


    The option to “Submit as Email” doesn’t include the form in the body of the mail, so here’s another way to encourage your form-fillers to send their forms as email and include that body.

    This script could be used in a Blogger form to turn on the Mail Envelope when the user switches to the “Email” view. That event could be triggered by the form-filler using the View menu, or even by a Rule on a button. It also makes some decisions based on the user’s current role so you can see how to do that.


    function XDocument::OnSwitchView(eventObj) {

      var mail = XDocument.View.Window.MailEnvelope;


      if (XDocument.View.Name == "Email") {

        // get nodes from DOM

        var blog = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:blog");


        var id       = blog.selectSingleNode("@ID");

        var title    = blog.selectSingleNode("@Title");

        var blogger  = blog.selectSingleNode("@BloggerName");

        var replies  = blog.selectNodes("d:reply/@ReplyName");


        // Set To field to include blog and the original blogger

        mail.To = "blog; " + blogger.text;


        // Set CC field to include all the replies (minus the current one)

        if (replies != null) {

          var cc = "";

          for (var i = 0; i < replies.length - 1; i++) {

            cc += replies(i).text + "; ";


          mail.CC = cc;



        // Set subject to look like a thread

        var subject = "Blog " + id.text + " - " + title.text;

        if (XDocument.Role != "Create")

          subject = "RE: " + subject;

        mail.Subject = subject;


        // Show the mail envelope

        mail.Visible = true;


      else {

          mail.Visible = false;




  • Microsoft InfoPath 2010

    More than one way to write code: Visual Studio and InfoPath

    If you need to write some Visual Basic or C# code behind your form, or maybe just some script, there are a few different tools you can use depending on which versions of InfoPath and Visual Studio you have.
    Here's a quick table summarizing it all:
    Note that both Microsoft Script Editor (MSE) and Visual Studio Tools for Applications (VSTA) come with InfoPath 2007 Beta, so you can open them from the Tools | Programming menu. If you don't see the one you want, change the language in Tools | Form Options. If it gives you an error that it's not installed, here's how to install them:
    1. If you are going to install VSTA, make sure you have the pre-requisites first:
    2. Go to Start > Control Panel > Add or Remove Programs
    3. Select your Office installation and click Change
    4. In the Office Setup wizard select to add features
    5. Find Microsoft Script Editor (under Office Tools) and/or Visual Studio Tools for Applications (under InfoPath > .NET Programmability) and select Run from my computer
    6. Finish the wizard
    Happy code writing!
    - Ned
  • Microsoft InfoPath 2010

    SPC Recap: Create Form Driven Mashups with the InfoPath Form Web Part


    The recent SharePoint Conference ended with a bang as Nick Dallett showed participants how they could create rich enterprise mashups by using InfoPath to create dynamic web parts without writing code.

    Nick showed off the new InfoPath form web part and demonstrated how easy it is for business users to use the web part to create composite applications together with other web parts that ship out of the box in SharePoint 2010, as well as custom web parts created by developers.

    Nick started by defining what an enterprise mashup is, pointing out three key points:
    - They are created by *business users*, not IT
    - They feature one or more sources of enterprise and public data
    - They provide visualizations of that data which helps users make better, faster, and more efficient decisions.

    He then went on to present 9 different scenarios where InfoPath was used as part of an enterprise mashup.  Each mashup illustrated a slightly different angle of the two design patterns that underlie all of the examples:

    1. The Connection-oriented design pattern, where web parts communicate using part-to-part connections, and
    2. The List-oriented design pattern, where web parts communicate by virtue of the fact that they are connected to one or more related lists

    1. Channel Analyzer (IDV Visual Fusion)
    (Design pattern 2 – list-oriented)

    Litware Channel Analyzer Application 

    IDV Solutions Logo

    Scott Caulk from IDV solutions ( gave a brief demonstration of an application built on their Visual Fusion product.  Visual Fusion is a rich Silverlight-based web part which allows users to aggregate multiple sources of data from the enterprise or the web, and visualize it in Bing maps.  Scott showed how a marketing manager for Litware books can use sales data plotted on the map to determine where a new promotional event may have the most impact.  The manager then clicks a button to fill out an InfoPath form to schedule a new marketing event.  Once submitted, data about all marketing events that have been scheduled is displayed on the map alongside the sales data.

    2. Customers and orders
    (Design pattern 1 – connection-oriented)

    Customers and Related Orders 

    Nick had some fun with the next two demos, which center around Contoso Office Supplies, where Nick moonlights as a salesman (wink wink).  After showing us the custom InfoPath form that he uses to display data from his customer list, Nick’s cell phone rang on stage, and after a brief moment of confusion (is he really going to answer a call in the middle of a presentation??), Nick let us know that the call was from Karie, the office manager over at Fabrikam.  It was all part of the show!   Karie wanted to know what pending orders she had so that she could put together the order for this week.  Nick showed how he could quickly pull related orders information into the display form’s web part page with just a few clicks, and was able to give Karie the information she needed.  Now that the web part page was modified, clicking on any customer in the list brought up not only their company information, but their pending orders as well.

    Key concept:   pull in related data using the “insert related list” action.

    3. New Order form
    (design pattern 1 – connection-oriented)

    New Order Form 

    Once off the phone, Nick put together a page from scratch displaying his customer list, with a list of orders for the currently selected customer, and an order form that was prepopulated with the customer information.  He explained the two connections that allowed him to filter the orders list based on the ID of the selected customer, and to tell the form to populate itself with customer data using a filter on a data connection to the customers list.  (NOTE: filtering and parameterized sharepoint list queries are both now supported in browser forms for SharePoint 2010!).

    Key concept: filter a data connection based on an incoming connection parameter.

    4. Customers master-detail
    (design pattern 1 – connection-oriented)

    Customers List - Master Detail 

    Nick pointed out that the simplest web part mashup to build is a master-detail scenario for a list with a custom InfoPath form.  He threw a list view onto a web part page, added an InfoPath form web part, and simply set up a connection using the “Get Form From” action to specify both the form and the connection to the list in one go.  Now, selecting a customer in the list displays the form for that customer alongside the list, allowing for quick access to data across multiple customers.

    Key Concept: build master-detail pages using the “Get Form From” connection action.

    5. Office Dogfood Voting
    (design pattern 2 – list-oriented)

    Office Build Voting Form 

    This mashup was an alternate implementation of a solution used at Microsoft to track the quality of Office builds.  As people install new builds and use them in their daily work, they can submit votes on whether the build is a good one (thumbs up) or a turkey (thumbs down), with some details.  The mashup page shows a list of builds, with aggregated information about votes cast about that build, and calculated columns which determine a rating for that build based on the number of yea or nay votes.  Nick demonstrated how the form works by submitting the vote to the underlying Votes list and then displaying a “Thank you” view to the user.  He then showed the workflow that increments the “for” and “against” counters for a build based on the submitted vote.

    Key concept: use data in a list to drive workflow and influence the display of other web parts.

    6. Microsoft Helpdesk
    (design pattern 1 – connection-oriented)

    Help Desk Form

    Next, Nick showed a page with two InfoPath forms and a list.  The Helpdesk form is an updated version of the form demonstrated in many of our InfoPath 2007 conference presentations.  It’s a rich form which shows a dynamically determined set of fields and values based on a problem category and problem area chosen by the user in a set of cascading dropdowns.  Based on the chosen category, the form sends a filter parameter, using the new Send Data to Web Part rule action, to filter a list of known solutions related to the problem category.

    A second InfoPath form in the page shows information about the logged-in user.  This display-only web part uses a query against the userprofile web service in SharePoint to bring in information from the User Profile Store.

    Key Concepts:  filtering dropdowns in the browser, using the Send Data To Web Part rule action, creating display-only web parts using InfoPath.

    7. Loan calculator
    (design pattern 1 – connection-oriented)

    Loan Calculator

    This demo showed how to use InfoPath to create a rich form that drives complex calculations in an Excel workbook hosted in Excel Services.  Nick used the Loan Calculator from Office Online, and a simple custom InfoPath form, put them both in a web part page, and then used SharePoint Designer to set up a multiple filter value connection between the form and the workbook.  The form adds default values, data validation, and visual pizzazz to the powerful calculation engine of Excel to create a compelling composite with no code.

    Key concepts:  connecting InfoPath forms with Excel, using SharePoint Designer to specify multi-valued connections.

    8. Insurance claims processing
    (design patterns 1 and 2 – list AND connection oriented)

     Insurance Claims Portal

    Nick showed a 4 part mashup centered around an insurance claims manager looking at claims submitted by customers in the wake of a violent storm.  Clicking on a claim in a list view shows the location of the claim in a custom web part using Bing maps, a photo of the damage in the Image Viewer web part, and an InfoPath form which allows him to assign an adjuster based on the geographic location and set a priority based on the damage photos.  The map shows all of the claims in the list (design pattern 2), but accepts a list item ID as a connection parameter, and centers the map on that pin when a list item is selected (design pattern 1).  Finally, clicking on a pin in the map displays the original form submission in a popup dialog using the showPopupDialog( ) javascript method.

    Key concepts: combine design patterns for complex scenarios, use Bing maps in custom Web parts, display InfoPath forms using showPopupDialog( ).

    9. The Microsoft Giving Campaign
    (design pattern 2 – list-oriented)

    Giving Campaign Web Site

    The final mashup of the day was built around the Microsoft Giving Campaign, which happens this time each year.  Employees are encouraged to donate to their favorite charities, and the donations are tracked to get an overall picture of employee giving.  The Give web mashup shows three web parts, including an InfoPath donation form, a chart web part showing aggregated donations by business division, and a custom Silverlight web part showing progress towards the campaign goal.  (The custom part is a project that Mike Ammerlaan from the SharePoint team demonstrated earlier in the week in his talk on creating web parts using Silverlight.).  This mashup features a similar structure to the Office Build Voting mashup shown earlier, in that there is a single list which contains all employee donations, and a second list which lists donations by business division.  Submitting a donation to the Donations list kicks off a workflow which updates the Divisions list with the new total donation amount.  The chart web part (which ships with SharePoint 2010) shows the breakdown of donations by division, and the Silverlight gauge web part shows a graphical representation of the total number of donations relative to a fixed goal.

    Key concepts: using custom Silverlight web parts, chart web part


  • Microsoft InfoPath 2010

    Converting a Data Source


    For anyone who has developed an InfoPath form template against a schema, database, or Web service that has changed since the form template was initially created, the following should be some good news.  The SP1 Preview Release of InfoPath contains the ability to provide InfoPath with an updated version of your schema or data source and InfoPath will update your solution accordingly.  That’s right, gone are the days of hand modifying the XSF, template file, XSL, etc. in order to change the schema.  You can change your main data source via the ToolsàConvert Main Data Source menu entry or a data connection via the modify button for that source in the ToolsàData Connection dialog.

    When you provide InfoPath the updated data source, InfoPath will update the schema files stored in the form template and look for and apply changes between the old and new data source.  In particular InfoPath will look for type changes, cardinality changes, namespace changes, adds, deletes, renames, and move operations.  For any recognized operation, all existing bindings in the view, XSF, and event handler hookup will be fixed accordingly (note, it is still your responsibility to fix business logic code.)  Unfortunately InfoPath is not omnipotent, so it might not be the best idea to wait until you have renamed, moved, and extremely modified the children of an element before providing the updated schema to InfoPath ;-)

    (And if a menu option to update your data source isn't convenient enough, tomorrow we'll start a five part series on the InfoPath Team Blog showing you how you can automate this sort of operation by taking advantage of InfoPath's XML-based form template file format.) 

  • Microsoft InfoPath 2010

    Help Us Improve InfoPath: Send Us Your Forms!


    The Microsoft Office InfoPath Team is interested in seeing how you are using InfoPath.  We would like you to send us your InfoPath forms so we can review them and collect data on how you are using the forms.  We will be using these forms to implement improvements in future versions of Microsoft Office InfoPath. We are interested in looking at a variety of forms ranging from simple to complex (in terms of length, rules, data connections, code, etc.).

    Please send us your forms at and include a brief description of how the form is used, what is working well for you and any suggestions for improvement. Also let us know if we can contact you with any follow up questions.

    We cannot guarantee that every form will be reviewed or that the confidentiality of the forms or information contained therein will be maintained.  We ask that you not submit forms containing confidential information.
    Thank you for your submissions.  We look forward to hearing from you.
    Microsoft Office InfoPath Team

  • Microsoft InfoPath 2010

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


    Part 3 of 5: Modifying the XSF


    Because manifest.xsf file is just a plain xml file, the easiest way to modify it is to open it in an XML DOM, find the corresponding attributes with XPath, and replace their existing values with new data.


    We will divide the process in two functions. The first one will be responsible for opening and saving the xml file. The second one will find and modify the attribute value.


    The serviceURL and wsdlURL parameters are strings with values like “http://mywebservice” and “http://mywebservice?WSDL” accordingly.


    var XsfNamespace =


    var XpathToServiceUrl =


    var XpathToWsdlUrl =



    function FixupXSF(xsfInputPath, xsfOutputPath, serviceURL, wsdlURL)


          var Fso = new ActiveXObject ("Scripting.FileSystemObject");

          var Dom = new ActiveXObject("msxml2.domdocument.5.0");



          Dom.validateOnParse=false; // for ignoring xsi:nil errors..



                      "xmlns:xsf='" + XsfNamespace + "'");


          // serviceURL

          if(serviceURL != null)


                ModifyAttribute(Dom, XpathToServiceUrl, serviceURL);



          // wsdlURL

          if(wsdlURL != null)


                ModifyAttribute(Dom, XpathToWsdlUrl, wsdlURL);



          if (Fso.FileExists(xsfOutputPath))

                Fso.DeleteFile(xsfOutputPath, true);     




    function ModifyAttribute(dom, xpath, value)


          var AttributeList = dom.selectNodes(xpath);

          for (;;)


                var Attribute = AttributeList.nextNode();

                if(Attribute == null)


                Attribute.nodeValue = value; 




    The XSF file was modified. Now we should restore our XSN and we will do it in the next part of the series.


  • Microsoft InfoPath 2010

    Cool Forms! Team Signoff Form


    This week’s cool InfoPath form is a simple form that we’re using for each team in Office to sign off that Office 2010 is ready to ship. One of the neat things about this form is that it makes the signoff process a visual experience by using conditional formatting to show and hide pictures based on the status.

    Signoff 1

    The form also contains rules to enforce that final signoff can only happen once both bug and testing signoffs have been completed.Signoff 2

    If you have a “cool” form that you would like to share with us, please send an e-mail with the following details to -

    • Attach 1 or 2 screenshots of your form
    • Provide a brief description of the form
    • You may also attach the XSN file (optional)

    The most popular submissions will be featured on our blog in future posts.

    Check out other Cool Forms! here.


    The InfoPath Team

  • Microsoft InfoPath 2010

    InfoPath SP1 Released - how to install on systems with InfoPath SP1 Preview


    You can now download and install the official InfoPath SP1.  It is part of the Office 2003 SP1 download.

    More details: .  English SP1 download is here.

    Please pay special attention to the following if you have installed the InfoPath 2003 SP1 Preview:

    InfoPath 2003 SP1 Preview and Office 2003 SP1

    If you previously installed the InfoPath 2003 SP1 Preview, you should uninstall the InfoPath 2003 SP1 Preview prior to installing Office 2003 SP1. You will need your original InfoPath 2003 product CD to upgrade to the final version of InfoPath 2003 SP1. For more information, see the Microsoft Knowledge Base article (873040): Information to consider before you apply Office 2003 Service Pack 1 to a computer that has the InfoPath 2003 Service Pack 1 Preview installed.

  • Microsoft InfoPath 2010

    Manage data in your SharePoint Lists using the InfoPath Form Web Part


    One of the powerful new features in InfoPath 2010 is the InfoPath Form Web Part.

    This is the 1st in a series of videos where we will show how to use the InfoPath Form Web Part to create rich mashups on portal pages in SharePoint, without writing a single line of code. In this video, Nick Dallett, a program manager lead on the InfoPath team, will demo two simple scenarios for managing data in your SharePoint lists using the InfoPath Form Web Part.


    Get Microsoft Silverlight


  • Microsoft InfoPath 2010

    What button was clicked?


    Another question that we get asked a lot:

    I include a Repeating Section control in my form, containing a Button and a Text Box. At runtime, a user inserts 5 items. How do I know which Button was clicked so I can get to the Text Box’s value?

    That’s actually the wrong question to ask. Strictly speaking, InfoPath doesn’t know the difference between the Buttons. They are all identical clones. What’s different about each button is its context within the view, and the view is mapped to the data. (In InfoPath it always comes back to the data.)

    If your schema looks like this:

    • myNodes
      • group1
        • group2 (repeating)
          • field1

    Your view probably looks something this:

    [View Structure]

    Since the Button control is inside the Repeating Section which is bound to group2, we say that the Button’s context is group2.

    So what?

    When the Button event is received, it contains a DocActionEvent object. The event object has a Source property. And this property is the Button’s context node – the specific group2 instance the Button is inside.

    So at this point, you can just use eventObj.Source to refer to data relative to the Button. Probably the easiest thing to do is just do some old school debugging using alerts. Here’s how to make sure you’re getting the context right:

    function CTRL3_5::OnClick(eventObj)


    // Write your code here

    XDocument.UI.Alert( eventObj.Source.xml );


    Here’s what you’d get:

        <my:group2 xmlns:my="">



    And to wrap things up, to get the text inside the Text Box, you need to use eventObj.Source.selectSingleNode():

    function CTRL3_5::OnClick(eventObj)


    // Write your code here

    XDocument.UI.Alert( eventObj.Source.selectSingleNode("my:field1").text );


  • Microsoft InfoPath 2010

    Understanding the InfoPath SP1 Deployment and Security Model – An Introduction


    A common question that was asked when people started using the initial InfoPath release was, “How can I distribute a form template to other people through email?”  In InfoPath V1, this was difficult because once you saved or published a form template to a location, it was ‘sited’ to that location.  If it was moved from that location, it would not open in the InfoPath Editor. 

    In the InfoPath Service Pack 1 release, it is now possible for form templates to be opened from locations other than their published location.  There is also a ‘Send Form as Attachment’ option under the File menu which attaches your form template to an Outlook mail message for distribution.  However, for security reasons, there are still limitations on what kinds of form templates can be opened and from what locations.  The following is a guide to understanding the InfoPath SP1 Deployment and Security Model:

    Form Template Security Level

    Each Form Template made in InfoPath SP1 has one of three security levels specified; Restricted, Domain, or Full Trust.  This setting is determined automatically by default, but can be set manually, if desired. 

    NOTE:  To access this setting in the Designer, navigate to Tools | Form Options à Security Tab. 

    Restricted – The form template does not allow any access outside of the form  

    Domain – The form template allows access outside of the form, but only within the domain of the form template

    Full Trust – The form template can access files and settings on the local computer

    The Full Trust security level can only be set manually by the user for installed templates or certificate-signed templates.  The maximum trust level that can be set automatically by InfoPath is Domain.

    All new blank form templates (except for Managed Code solutions) start out at the Restricted security level.  As you build the form, adding any of the following will automatically raise the security level to Domain:

    • Task Pane
    • Script
    • ADO Query or Submit Adapter
    • Web Service Query or Submit Adapter
    • SharePoint Query or Submit Adapter
    • Query to linked XML file
    • HTTP Submit
    • ActiveX Control
    • Roles
    • DLL Resource File
    • HWS
    • Rule that opens a new document 

    Opening the Form Templates in the InfoPath SP1 Editor

    The reason to make a distinction between Restricted and Domain security was to allow for form templates without script or data connections to be opened from anywhere.  Therefore, email deployment of restricted form templates in SP1 is easy, just send out the form template and it can be opened either from the Outlook mail itself or from wherever the recipient saves it. 

    With Domain form templates, some of the same security restrictions from v1 still exist, but SP1 allows for some added functionality.  Domain form templates still require that they be opened from their published location.  However, by using the Send Form as Attachment option in the file menu, a Domain form template can be mailed out as an attachment.  This attachment, when received and opened, functions as a link to the actual published location.  The form template at that publish location is what actually gets opened in the InfoPath Editor, not the one that was clicked on.  At that point as well, the published form template is copied locally and will appear as a selection in the Fill Out a Form dialog every time you launch InfoPath.

    Future Considerations

    This posting is meant as an introduction and does not cover all aspects of Deployment and Security.  If there are any specific questions, please respond via feedback to this article and I will follow up with further entries that will address more specific functionalities and scenarios.

  • Microsoft InfoPath 2010

    Cool Forms! E-mails to CoolForm@Microsoft not getting through


    It was brought to our attention that external e-mails that were sent to were not getting through. This issue has now been resolved.

    If you have a “cool” form that you would like to share with us, please send an e-mail with the following details to -

    • Attach 1 or 2 screenshots of your form
    • Provide a brief description of the form
    • You may also attach the XSN file (optional)

    The most popular submissions will be featured on our blog in future posts.

    Check out other Cool Forms here.

Page 7 of 12 (298 items) «56789»