Creating a Word doc generated from InfoPath 2003 data

K

Karen

Hi,

I'm very new to InfoPath. I've read several articles and they all seem to
cover many, but not all the steps necessary. I'm definitely missing
something...

I'm trying to generate a Word document using a "template" Word doc merged
with data from an InfoPath form.

I did the following
- created a form in InfoPath 2003 and extracted the schema
- created a Word doc, added the schema, inserted several data elements
from the schema into the doc, and saved it as an .html and .doc (different
articles said different things)
- ran the wizard and gave it the .xsd and the .doc and had it create the
..xsl
- added the print view to the InfoPath form and selected it for printing
for the default view
- filled out the InfoPath form and saved it as an xml
- executed PrnInWord.js file_name.xml file_name.xsl
- I also tried printing it from InfoPath after I filled in the form

Both of these printed the Word doc with blank values for the data elements.

Even if I do get the doc to print, what I really want is to create a new
Word doc which is the "template" doc merged with the data values from the
InfoPath form. This will allow additional modification of the document after
the form data is embedded.

Thanks in advance for your help.

Regards,
Karen
 
W

willib

Hello Karen,

there is a WordML Viewer for the IE.
It allows viewing the XML (infopath xml) with a XSLT
That can be a Stylesheet that produces WordML like the output of the Wizzard


Or open the xml-File with Word2003pro / Word2007
Then the taskpane should show a list of Stylesheets to apply, and an Button
to add your xslt-Files.
and apply the Stylesheet.
Be aware that one Change in the Dokument, let word switch to the output, and
you couldn't go back to the taskpane selection.

hth
willib
 
K

Karen

Hi,

Yes, I found that last night and tried it, but no luck. After reading your
post I decided to try again, this time with a very simple form like the one
in that article, but still no luck. What I find is that the doc it generates
is identical to the xml that I formatted as the "seed" doc. The new data
that I enter into the form before hitting the "transform" button never makes
its way into the Word doc that pops up. Is there something that I need to do
before hitting the "transform" button? Do I need to save the form data into
a file? Does the file need to have a specific name and/or be in a specific
location?

The instructions in the article are so specific I can't see where I could
have gone wrong. The only thing that it doesn't warn you about is when you
run WML2XSLT.EXE it comes up with "Multiple namespaces were found in the
document. Please select the namespace(s) to process".

Any help you can provide would be most welcome.

Regards,
Karen
 
D

darkstar

Hi, Karen:

This drove me crazy at first too. Through trial and error, I figured
out that when you run WML2XSLT.EXE you should select the InfoPath
schema and not the one for Word. In my test, it looks like this:

http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-05-12T21:53:03

It worked fine after that. The beauty of this approach is that you can
have a single form for data input that can contain multiple
transformations ("templates") you can create and choose from depending
on the document you need to generate.
 
K

Karen

Hi,

That's exactly what I'm trying to do. It seems like such a great idea.
With your help I've managed to get a basic form/doc working (thank you very
much!), but I need so much more! When I try to add text to the doc I get the
warning "Text is not allowed in the context of element... Expecting..." The
only place I seem to be able to add text is on its own line above or below
the tags. Is it possible to embed tags in the middle of a doc? Also, do the
tags need to appear in the doc in the same order that they're in the xsd?

Thank you in advance.

Regards,
Karen
 
W

willib

Hello,


When I try to add text to the doc I get the warning "Text is not
allowed in the context of element... Expecting..."
The only place I seem to be able to add text is on its own line above or
below the tags.
Is it possible to embed tags in the middle of a doc?
Also, do the tags need to appear in the doc in the same order that
they're in the xsd?

In Word you will find a option in the XML-Option Dialog: ignore
MixedContent
Yes, the order of the elements in Word does affect validation against a
schema.


Some hints:
with word-sp2 comes a new namespace into the serialisation that was not
known by the tool WML2XSLT.EXE ..
The Handling of NewLines in XML and WordML needs special treatment


hth
willib
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top