Convert InfoPath To Word

R

ridawg

S.Y.M. Wong-A-Ton - wasn't sure if you noticed my follow up on this so I'm
re-posting it. I was side tracked for a little bit and just got back to
working on this.

I've run into a couple of problems and I'm sure you can help me out.

First, when I convert my formatted XML form into XSL using the Transform
Tool I get the following Dialog box - Multiple namspaces were found in the
document (the namespaces are listed and I can select them both or one or the
other)
1.
http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-11-27T14:41:33
2. http://schemas.microsoft.com/office/word/2003/wordml/sp2

I've selected them both and each one separtely but I still can't get this to
work.

The following is the error I get when I actually click the button I've
created.
Object required: '[string: "<?xml version="1.0" "]'
Line 34

Line 33 & 34 are the following:
Dim formInWordML
set formInWordML = formInXML.transformNode(xslXMLToWordML)

I've created a very basic form. Just 3 fields. I'm just trying to get this
to work in VBScript before I try to use it in my more complicated forms.

If you need me to post all the code just let me know.

Thanks for the help!
 
W

willib

Hello

The Inferencetool is older than sp2, so it does not recognize the sp2
namespace.
with the -ns namespace parameter you can specify the namespace for xml2xslt
to process.

Willi

ridawg said:
S.Y.M. Wong-A-Ton - wasn't sure if you noticed my follow up on this so I'm
re-posting it. I was side tracked for a little bit and just got back to
working on this.

I've run into a couple of problems and I'm sure you can help me out.

First, when I convert my formatted XML form into XSL using the Transform
Tool I get the following Dialog box - Multiple namspaces were found in the
document (the namespaces are listed and I can select them both or one or the
other)
1.
http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-11-27T14:41:33
2. http://schemas.microsoft.com/office/word/2003/wordml/sp2

I've selected them both and each one separtely but I still can't get this to
work.

The following is the error I get when I actually click the button I've
created.
Object required: '[string: "<?xml version="1.0" "]'
Line 34

Line 33 & 34 are the following:
Dim formInWordML
set formInWordML = formInXML.transformNode(xslXMLToWordML)

I've created a very basic form. Just 3 fields. I'm just trying to get this
to work in VBScript before I try to use it in my more complicated forms.

If you need me to post all the code just let me know.

Thanks for the help!
 
S

S.Y.M. Wong-A-Ton

If you're getting an "Object required" error it means that one of the objects
have not been set properly... I'm guessing xslXMLToWordML.

Double-check whether you have the following:
Dim formInXML
Set formInXML = XDocument.DOM
Dim xslXMLToWordML
Set xslXMLToWordML = XDocument.GetDOM("XMLToWordML")
 
S

S.Y.M. Wong-A-Ton

I did not receive any prompting for namespaces when running the tool. Another
option is to create the XSL file manually. The tool is just to help people
who are not that well-versed in XSL. But I've read that it has its
shortcomings.

Did you use your own form or create the form as indicated in the article?

When I get a chance, I'll try to convert the sample solution into one that
uses VBScript. Let me know if the JScript version also gives you the same
issue. If it does, I'll try to put up some instructions on how to create the
XSL file manually.
---
S.Y.M. Wong-A-Ton


ridawg said:
Thanks for getting back to me.

I've checked my code and it matches exactly what you wrote in your response.
I didn't really understand what willib suggested - something to do with
setting the namespace parameter because the Inference Tool is older than SP2.
Is that something I need to do?

I've tried this a couple of times now from scratch and I still get the
dialog box asking me to select a namespace and I'm still getting the object
error. Not sure where I went wrong. Thought I would try and do this in
JScript exactly as you describe in your article just to see if I can at least
get a working example to compare to my VBScript attempt.

Thanks for the help and patience!

--
-ridawg


S.Y.M. Wong-A-Ton said:
If you're getting an "Object required" error it means that one of the objects
have not been set properly... I'm guessing xslXMLToWordML.

Double-check whether you have the following:
Dim formInXML
Set formInXML = XDocument.DOM
Dim xslXMLToWordML
Set xslXMLToWordML = XDocument.GetDOM("XMLToWordML")
---
S.Y.M. Wong-A-Ton


ridawg said:
S.Y.M. Wong-A-Ton - wasn't sure if you noticed my follow up on this so I'm
re-posting it. I was side tracked for a little bit and just got back to
working on this.

I've run into a couple of problems and I'm sure you can help me out.

First, when I convert my formatted XML form into XSL using the Transform
Tool I get the following Dialog box - Multiple namspaces were found in the
document (the namespaces are listed and I can select them both or one or the
other)
1.
http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-11-27T14:41:33
2. http://schemas.microsoft.com/office/word/2003/wordml/sp2

I've selected them both and each one separtely but I still can't get this to
work.

The following is the error I get when I actually click the button I've
created.
Object required: '[string: "<?xml version="1.0" "]'
Line 34

Line 33 & 34 are the following:
Dim formInWordML
set formInWordML = formInXML.transformNode(xslXMLToWordML)

I've created a very basic form. Just 3 fields. I'm just trying to get this
to work in VBScript before I try to use it in my more complicated forms.

If you need me to post all the code just let me know.

Thanks for the help!
 
R

ridawg

Just got back to working on this. I tried to create your example exactly and
I'm still having problems but I have made some progress I think.

This is what I've done:
1. I created a template with 3 text boxes.
2. Created a new form, entered data in the text boxes and saved it as an XML
file.
3. Opened the saved file in Word and formatted it.
4. Saved the Word file as XML and cleared the Save Data only option.
5. Used the Inference Tool to create the XMLToWordML.xsl file. I'm still
receiving the dialog box regarding multiple namespaces. I went with the
Select All option.
6. Updated my template by adding the data connection for the XMLToWordML.xsl
file.
7. Added the code to the button - I did it in JScript instead of VBScript
this time. Also, I only added the code down to where a file is created.
That's all I need. I don't need the Outlook piece. And I set up the form for
full trust using a digital certificate.
8. I saved the updated template then created a new form to see if everything
worked.

It doesn't work but I think I'm closer. I'm no longer receiving the Object
required error. It did create a new file called InfoPathFormInWordML.xml but
none of the data I entered was in the file that was created. I'm not sure if
it is related to the namespace dialog but for whatever reason it appears I'm
not retrieving the form data. I've checked several times and my code matches
your's exactly.

You mentionted that you may provide some info on how to manually create the
XSL file - do you think this would solve my problem? I don't know how to
manually create an XSL file but I would be willing to give it a try.

Thanks for all the help!
--
-ridawg


S.Y.M. Wong-A-Ton said:
I did not receive any prompting for namespaces when running the tool. Another
option is to create the XSL file manually. The tool is just to help people
who are not that well-versed in XSL. But I've read that it has its
shortcomings.

Did you use your own form or create the form as indicated in the article?

When I get a chance, I'll try to convert the sample solution into one that
uses VBScript. Let me know if the JScript version also gives you the same
issue. If it does, I'll try to put up some instructions on how to create the
XSL file manually.
---
S.Y.M. Wong-A-Ton


ridawg said:
Thanks for getting back to me.

I've checked my code and it matches exactly what you wrote in your response.
I didn't really understand what willib suggested - something to do with
setting the namespace parameter because the Inference Tool is older than SP2.
Is that something I need to do?

I've tried this a couple of times now from scratch and I still get the
dialog box asking me to select a namespace and I'm still getting the object
error. Not sure where I went wrong. Thought I would try and do this in
JScript exactly as you describe in your article just to see if I can at least
get a working example to compare to my VBScript attempt.

Thanks for the help and patience!

--
-ridawg


S.Y.M. Wong-A-Ton said:
If you're getting an "Object required" error it means that one of the objects
have not been set properly... I'm guessing xslXMLToWordML.

Double-check whether you have the following:
Dim formInXML
Set formInXML = XDocument.DOM
Dim xslXMLToWordML
Set xslXMLToWordML = XDocument.GetDOM("XMLToWordML")
---
S.Y.M. Wong-A-Ton


:

S.Y.M. Wong-A-Ton - wasn't sure if you noticed my follow up on this so I'm
re-posting it. I was side tracked for a little bit and just got back to
working on this.

I've run into a couple of problems and I'm sure you can help me out.

First, when I convert my formatted XML form into XSL using the Transform
Tool I get the following Dialog box - Multiple namspaces were found in the
document (the namespaces are listed and I can select them both or one or the
other)
1.
http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-11-27T14:41:33
2. http://schemas.microsoft.com/office/word/2003/wordml/sp2

I've selected them both and each one separtely but I still can't get this to
work.

The following is the error I get when I actually click the button I've
created.
Object required: '[string: "<?xml version="1.0" "]'
Line 34

Line 33 & 34 are the following:
Dim formInWordML
set formInWordML = formInXML.transformNode(xslXMLToWordML)

I've created a very basic form. Just 3 fields. I'm just trying to get this
to work in VBScript before I try to use it in my more complicated forms.

If you need me to post all the code just let me know.

Thanks for the help!
 
R

ridawg

I figured out how to do this!!

When you're prompted to select the namespaces only select the namespace
related to InfoPath (ignore the word sp2 namespace). Also, have a couple of
tries I was able to convert the jscript code from your article into vbscript.
Very cool.

Thanks for the help and if anybody has any questions or would like to see
the vbscript code I wrote let me know.
--
-ridawg


S.Y.M. Wong-A-Ton said:
I did not receive any prompting for namespaces when running the tool. Another
option is to create the XSL file manually. The tool is just to help people
who are not that well-versed in XSL. But I've read that it has its
shortcomings.

Did you use your own form or create the form as indicated in the article?

When I get a chance, I'll try to convert the sample solution into one that
uses VBScript. Let me know if the JScript version also gives you the same
issue. If it does, I'll try to put up some instructions on how to create the
XSL file manually.
---
S.Y.M. Wong-A-Ton


ridawg said:
Thanks for getting back to me.

I've checked my code and it matches exactly what you wrote in your response.
I didn't really understand what willib suggested - something to do with
setting the namespace parameter because the Inference Tool is older than SP2.
Is that something I need to do?

I've tried this a couple of times now from scratch and I still get the
dialog box asking me to select a namespace and I'm still getting the object
error. Not sure where I went wrong. Thought I would try and do this in
JScript exactly as you describe in your article just to see if I can at least
get a working example to compare to my VBScript attempt.

Thanks for the help and patience!

--
-ridawg


S.Y.M. Wong-A-Ton said:
If you're getting an "Object required" error it means that one of the objects
have not been set properly... I'm guessing xslXMLToWordML.

Double-check whether you have the following:
Dim formInXML
Set formInXML = XDocument.DOM
Dim xslXMLToWordML
Set xslXMLToWordML = XDocument.GetDOM("XMLToWordML")
---
S.Y.M. Wong-A-Ton


:

S.Y.M. Wong-A-Ton - wasn't sure if you noticed my follow up on this so I'm
re-posting it. I was side tracked for a little bit and just got back to
working on this.

I've run into a couple of problems and I'm sure you can help me out.

First, when I convert my formatted XML form into XSL using the Transform
Tool I get the following Dialog box - Multiple namspaces were found in the
document (the namespaces are listed and I can select them both or one or the
other)
1.
http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-11-27T14:41:33
2. http://schemas.microsoft.com/office/word/2003/wordml/sp2

I've selected them both and each one separtely but I still can't get this to
work.

The following is the error I get when I actually click the button I've
created.
Object required: '[string: "<?xml version="1.0" "]'
Line 34

Line 33 & 34 are the following:
Dim formInWordML
set formInWordML = formInXML.transformNode(xslXMLToWordML)

I've created a very basic form. Just 3 fields. I'm just trying to get this
to work in VBScript before I try to use it in my more complicated forms.

If you need me to post all the code just let me know.

Thanks for the help!
 
S

S.Y.M. Wong-A-Ton

I'm glad you finally got it sorted. And thank you for posting what you did to
solve the namespace problem; I'm sure it will benefit others.
---
S.Y.M. Wong-A-Ton


ridawg said:
I figured out how to do this!!

When you're prompted to select the namespaces only select the namespace
related to InfoPath (ignore the word sp2 namespace). Also, have a couple of
tries I was able to convert the jscript code from your article into vbscript.
Very cool.

Thanks for the help and if anybody has any questions or would like to see
the vbscript code I wrote let me know.
--
-ridawg


S.Y.M. Wong-A-Ton said:
I did not receive any prompting for namespaces when running the tool. Another
option is to create the XSL file manually. The tool is just to help people
who are not that well-versed in XSL. But I've read that it has its
shortcomings.

Did you use your own form or create the form as indicated in the article?

When I get a chance, I'll try to convert the sample solution into one that
uses VBScript. Let me know if the JScript version also gives you the same
issue. If it does, I'll try to put up some instructions on how to create the
XSL file manually.
---
S.Y.M. Wong-A-Ton


ridawg said:
Thanks for getting back to me.

I've checked my code and it matches exactly what you wrote in your response.
I didn't really understand what willib suggested - something to do with
setting the namespace parameter because the Inference Tool is older than SP2.
Is that something I need to do?

I've tried this a couple of times now from scratch and I still get the
dialog box asking me to select a namespace and I'm still getting the object
error. Not sure where I went wrong. Thought I would try and do this in
JScript exactly as you describe in your article just to see if I can at least
get a working example to compare to my VBScript attempt.

Thanks for the help and patience!

--
-ridawg


:

If you're getting an "Object required" error it means that one of the objects
have not been set properly... I'm guessing xslXMLToWordML.

Double-check whether you have the following:
Dim formInXML
Set formInXML = XDocument.DOM
Dim xslXMLToWordML
Set xslXMLToWordML = XDocument.GetDOM("XMLToWordML")
---
S.Y.M. Wong-A-Ton


:

S.Y.M. Wong-A-Ton - wasn't sure if you noticed my follow up on this so I'm
re-posting it. I was side tracked for a little bit and just got back to
working on this.

I've run into a couple of problems and I'm sure you can help me out.

First, when I convert my formatted XML form into XSL using the Transform
Tool I get the following Dialog box - Multiple namspaces were found in the
document (the namespaces are listed and I can select them both or one or the
other)
1.
http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-11-27T14:41:33
2. http://schemas.microsoft.com/office/word/2003/wordml/sp2

I've selected them both and each one separtely but I still can't get this to
work.

The following is the error I get when I actually click the button I've
created.
Object required: '[string: "<?xml version="1.0" "]'
Line 34

Line 33 & 34 are the following:
Dim formInWordML
set formInWordML = formInXML.transformNode(xslXMLToWordML)

I've created a very basic form. Just 3 fields. I'm just trying to get this
to work in VBScript before I try to use it in my more complicated forms.

If you need me to post all the code just let me know.

Thanks for the help!
 

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