
Views are a native part of InfoPath 2007 that
allow us to create one data source, but display the data in many different
ways, even to different people in different ways. For example you might have
one view for an order form and another view for the order summary. However,
there is a special view called Print View for Word that is entirely
different. This option allows you to designate an XSLT that will take the
form data and apply the transform to render out WordProcessingML, which can
be opened in Word 2003 or later. To create a Word Print view complete the
following steps:
-
Install the InfoPath 2003 SDK (yes, I know it states 2003).
- Run the Word Print wizard called
wizard.hta located in %Program Files%\Microsoft Office 2003 Developer
Resources\Microsoft Office InfoPath 2003 SDK\Tools\WordPrint.
- Click Next to start the wizard.
NOTE: If you receive an error message regarding missing or unregistered
DLL files, go to Start Run and enter regsvr32 “C:\Program
Files\Microsoft Office 2003 Developer Resources\Microsoft Office
InfoPath 2003 SDK\Tools\WordPrint\wordprint.dll”. You may also have to
run this for html2xhtml.dll and imageDecode.dll
- Once you launch the wizard you will
see the Welcome to the InfoPath to Word Wizard dialog box. Click Next.
- On the next screen, browse to your
form and select it. Note that you could just use a schema, but the
wizard provides some additional functionality if you point to the
InfoPath form template (*.xsn). In my example I am opening my Order
Form.

- Click Next.
- The next screen offers the option of
opening Word 2003 (if you have Word 2007 installed it will open that
instead, but it will not change the text on the button).
- Click the Open Word 2003 button.
- You’ll be presented with a blank
document, with the XML Structure pane open. The form’s XML structure is
already attached to the list at the bottom of the pane.
- You can now create the form as shown
below. When you are done with the Word form, close and save the
document.

- Return to the wizard and click Next.
- One the next page, browse to the
location where you stored the word file and click Next.
- Give your Word Print view a memorable
name.
- Click Next and Finish. This will
generate the XSLT file in the same location as the Word document. Click
Congratulations on the final screen.
- Now reopen your InfoPath form in the
InfoPath 2007 design mode.
- Open the Design Task pane and click
Views
- Click the “Add Print View for Word”
link at the bottom of the Views task pane.
- This wizard will install the XSL file
into your InfoPath form template. Click Next.
- Browse to the location where the Word
print wizard stored your XSL file and click Next.
- Give your Word print view a name and
click Next
- Click Finish.
Your print view will not show up in the
views listing.
- Select a view and click the View
Properties.
- Select the Print Settings tab and set
the print view to the Word Print view you just created.

- You can test it by filling out your
data and clicking print.
Sharee
English (MCSD, MCAD, MCT) is
the Director of Information Services at
SeattlePro Enterprises,
an IT training and consulting company. She started her career as a
programmer, delving into Web technologies almost twenty years ago. Today she is
a highly educated executive with background in software development, training,
authoring,
management, operations, administration and sales. Sharee holds a Master of Arts
in Management (emphasis in Information Systems), a Bachelor of Science (B.S.) in
Computer Science and a B.S. in Mathematics.
If you would like to provide feedback on this article,
please click
here.
Copyright ©2009
SeattlePro Enterprises. All rights reserved.