InfoPath 2007: Creating a Template Part

Creating a basic Template Part in Microsoft Office InfoPath 2007 is a simple process.  However the rewards that come along afterwards when you have a nice library of template parts is quite nice.  In this post I will give a high level walkthrough of the steps it takes so you can see yourself how easy they are to create and hopefully recognize a few of the benefits of possibly a little work upfront.

Creating a Template Part in InfoPath 2007

Open InfoPath 2007 and select to Design a Form Template

Design a Form Template in InfoPath 2007
You are given a choice to create either a complete form or a template part.  Because the component you are going to create will be used in multiple forms, it makes sense to package it as a template part instead.  In this example, I will create a template part for contact information since it is contained in probably half the forms I make.  Even if some slight items change, using a template part will give me a good starting point.

By selecting template part, you are given a choice to create from a blank template or based on an XML document or schema.  In this case we will select Blank.

InfoPath 2007 Create a Template Part
You design your form by adding the appropriate layout tables and controls to the form.  It is always a good idea to begin this step with a sketched out idea of what your form will look like on paper and the data the form will collect including any dependencies or connections identified.

Similar to a complete template, you can import data from other data sources such as SQL, web services or SharePoint.  In this case, I have a list of provinces contained on a centrally available SharePoint site so I will utilize that.  You never know when Canada could decide to recruit a new province or territory so its important to make it easy for this listing to stay up to date.  OK So maybe in this case I just hate typing so it’s easier for me to grab this information from a central listing somewhere.


After all my labels and controls have been added, I am ready to save my template part.

InfoPath 2007 Save Template Part

When you save the template part you will notice it has its own unique file extension (xtp) rather than the xsn you would see if you were saving a complete form.

InfoPath 2007 File Extension xtp for a Template Part


Now whenever I want to create a form that contains contact information, I can simply add my template part instead of recreating every single field manually.  Who has time for manual recreation of common elements when there are Stanley Cup Finals or World Cup Soccer games to watch? 

Below the controls listing on the task pane select the link to “Add or Remove Custom Controls…”

InfoPath 2007 Add Custom Controls

Select Template Part from the wizard screen…

InfoPath 2007 Import a Template Part

Browse to the location of your template part.  If you are working on a team, then it would be a good idea to store these in a central location so as to be a library for everyone to use.

InfoPath 2007 Select Template Part for Upload

And Voila you have a new custom control available to you in the task pane.

InfoPath 2007 - Template Parts

InfoPath 2007 Template Part 


Just like any other control, click and drag it onto the form to make it appear.  


Depending on the complexity of your template part, you can evaluate the benefit of using template parts by comparing the length of time it takes to click and drag versus the length of time it took you to add all the controls and set up your data connection, then multiply it by the number of times you would typically have to add those fields to a form.

Beginning SharePoint 2007 – Our First Book Review, by Mike Walsh

I’m glad to say that our book, Beginning SharePoint 2007 is now available to the masses.  Amanda and I are both eagerly awaiting reviews which is why we were pleased to see that Mike Walsh appears to be the first out of the gate to talk about it.

Those of you who know Mike Walsh know that he really isn’t one to “kick things under the rug” if he doesn’t like it, he will tell you so I can confidently say that you will get a pretty accurate description from him.

You might notice at times during the course of the book (and in Mikes review) the mention of SharePoint versus WSS.  Unfortunately during a very rigorous editing process, it’s relatively easily for ‘simple’ cut/paste or change jobs to fly under the radar unnoticed and this is one of those times.

So, when you see WSS versus SharePoint just keep in mind that it should read WSS versus MOSS.  When referring to SharePoint 2007, we are referring to MOSS 2007 + WSS 3.0  collectively.

Read Mike’s review on Beginning SharePoint 2007.

Create more accessible SharePoint sites

By now it should come as no great shock that web standards, and accessibility are incredibly important to ‘any website’, yes this very much includes SharePoint sites.  It’s not to see Microsoft and the SharePoint Team shining some light on the importance of the situation and equally impressive to see partners and vendors coming to the table with more and more solutions.

One which sparked my interest this morning from HiSoftware is AccRepair v11.0 for Microsoft SharePoint Designer

AccRepair v11.0 for Microsoft SharePoint Designer and Expression is an integrated solution that allows developers and content providers to test and repair content created with SharePoint Designer and Expression from within those applications prior to publishing in the production environment. This allows users to validate and remediate content at the time and place of content creation.

Great work!