WordML Schema generation - ms-word

I need the xml template for Word 2007. In Word 2003 it starts like the following and continues. What I need is the generic template of Word 2007 in xml format which can be used as the base for WordML to xml transformations and viceversa. Someone experienced in WordML would definitely know what I am asking for! If you have used docbook roundtripping, what I need is the template document which can be used for the "wordml.template" parameter. The template for Word 2003 is already there. I need the template for Word 2007. If someone knows please let me know how to have that. Thanks!
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?mso-application progid="Word.Document"?>
<w:wordDocument>xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"..........."

See my answer to your earlier question (which got closed): XML schema for Offfice 2007
There is a difference between a sample XML file which validates against a schema, and the schema itself.
I told you how to create a sample XML file, which, best I can tell, is what you are still asking for here.
Open the Word 2003 template in Word, then "save as" XML (Word 2007 XML). That should do it.

There is more than one schema. You may be able to get them here:
http://www.microsoft.com/en-us/download/details.aspx?id=4463

Related

Generate .hhk file From Word Document

I am trying to convert MS Word file to chm file. I have a well organized word document. But,I could not figure out how to word saved as a html file to chm file. I know I can add html file to created project but there are some issue such that I could not solve how to convert ms word table of content file to index file in html help workshop program. I would be very happy If someone provide some example about conversion of word documents.(I am trying to achieve this thorough HTML Help Workshop program)
Best regards,
Converting a Word document to CHM format is difficult without special (often expensive) tools and has a learning curve.
You should think about whether the PDF format is not sufficient. But the CHM format - integrated in the Windows operating system - has of course some popular functions.
I recommend to read through Search and Index not working after converting from Word 2016 to CHM.
As I mentioned in my answer I never used chmProcessor before (because using other tools) but surprisingly seems to be a good one for converting Word documents in a simple way.
Please try chmProcessor for your needs. You may want to ask a new question here on SO later.
Edit:
Maybe you have additional interest in the following CodeProject article:
How to Easily Write a User's Guide for Your Application using Different File Extensions

Word 2010 additional file format

I'm not sure whether this is the best approach for this or whether I perhaps should ask the question more clearer.
What I want to do is to create an additional file output - e.g. if the user uses Word to create a description consisting of known tags, I want to be able to save this as bbcode.
Now I do have an idea of how to do this, but is there a way to say add another file format to the "Save file"-dialog box and have it run a parser and file writer, that'd read the current document and export it using known bbcode-tags (that perhaps would be adjustable from some configuration window)?
The result would be a file containing bbcode as well as the text information that the user has entered.
How would I hook up my addin to the file output dialog? Is there a way to do this? I'm not sure it's custom XML since I won't be using the XML at all.
Thanks in advance and please excuse my poor English.
Edit: after having a look at the Word 2010 AddIn-project, I figured, that I'm looking for a way to define my own "export"-format. I'd like to export the BBCode to a .txt (or even .bbcode) file. The Microsoft.Office.Interop.Word.WdExportFormat seems to have its own fixed enumeration. Is there a way to add an export-format?
There is some code for this here:
phpbb.com/community/viewtopic.php?f=17&t=395554

How to convert Word 2007 document to PDF using Apache FOP

I am currently using Apache FOP and have a stylesheet (possibly from RenderX) that converts Word 2003 XML documents (Saved as XML option) to PDF. However, this does not work for Word 2007 XML documents.
I am looking for options and/or suggestions on how to accomplish one of the following tasks -
Get a stylesheet that will transform Word 2007 XML file to:
Word 2003 XML or
PDF using FOP (using a stylesheet to create xsl-fo)
I am also open to any other options you might have. If possible I would like to do this with little to no cost. However, I am limited to using Java so a C# type option is not possible.
Thanks,
You could try docx4j, an open source Java library (ASL v2) which uses FOP to create PDFs from docx files.
I'm not aware of any style sheets that do this transformation. It would be reasonably sophisticated. If you end up having to engineer another way of doing it, you might want to look at JODConverter (straight conversion - might be your best bet), the OpenOffice UNO API (very manual), JODReports or Docmosis (both can produce documents in various formats). All can produce PDFs from a Java environment. I think they all have free versions.
Hope that helps.

Word Open XML Mail Merge

I'm attempting to manually create a mail merge using Word's XML (from Word 2007). I have the following XML which isn't working:
<w:mailMerge>
<w:mainDocumentType w:val="catalog" />
<w:linkToQuery />
<w:dataType w:val="native" />
<w:connectString w:val="Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=TheServer;Data Source=." />
<w:query w:val="SELECT * FROM `Table` WHERE `id_field` = 7" />
<w:dataSource r:id="rId1" />
<w:activeRecord w:val="0" />
</w:mailMerge>
I can't really figure out from the documentation what I'm supposed to do. This is just a mail merge from a database table. It says there's an error on the line <w:mainDocumentType w:val="catalog" />. I've looked up possible values of w:val without any luck. I can't find any decent documentation on it.
Anyone have any ideas?
DII has all of the documentation and you can also look up on this site, like the mainDocumentType is listed as a CT_MailMergeDocType. Upon searching for that, I get which then tells me to look up ST_MailMergeDocType, where it lists the types.
Also, OpenXML Developer has some basic intro articles to MailMerge with WordprocessingML:
Mail merge in WordProcessingML using
System.IO.Packaging API
Mail Merge in WordProcessingML
Can this be of some help?
Mail Merging With Word and Linq-to-Xml in VB
in your sql command you aren't using regular single quotes (') but the kind i see when people have international keyboards ( "`" vs "'" ). i don't know how the SQLOLEDB provider works but i am used to seeing brackets around table and cloumn names rather than quotes.
using microsoft word, set up mail merging in a test document just how you want it. then view the xml that word generated using the Open XML SDK Tool which you can get here:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5124
compare the xml that word generates to your code to see where you may have gone wrong.
note that a w:mailMerge may depend on an external resource, in which case you include a data source reference.

Writing MS Word 2007 XML

How would I write Word 2007 XML (WordProcessingML) on my own? I have a requirement to do so, where I need to write a Word 2007 XML format for a Word template. The important thing is I should convert a Word template doc to XML (by zipping it, etc), where I need to write Word 2007 XML with those respective tags. How can I do this?
docx4j
I'm not sure what you mean by "on your own," but there is an existing API for this:
Apache POI - the Java API for Microsoft Documents
If it doesn't do what you need it to, just extend it.
Go to OpenXMLDeveloper - you can get most of the information there on WordprocessingML and links out to other places.