tags:

views:

161

answers:

6

Is there a dev kit/lib (written in c or c++) to write docx files? Microsoft has a dev kit, but it's written in C#.

A: 

Try: http://msdn.microsoft.com/en-us/library/bb448854.aspx

HJ
Isn't that .NET?
Daniel Trebbien
A: 

Not a kit, but you can try the Word Automation Class, which would work for Word 2007/2010 as well. Details on this answer.

Otaku
+1  A: 

I don't know the answer directly but if you can't find one, can you just writed a C# managed com object that exposes what you need and then just call CoCreateInstance to access the type library from c or c++?

Steve Sheldon
A: 

Given the complexity of the XML schema behind OOXML (the Open Office XML file format behind .docx files), you might want to consider using a tool to help you create an XSLT stylesheet that can generate the required output XML. Then use one of the C based XSLT engines (XT or Xalan-c from memory) to do the transform(s) before zipping them up.

Altova's Stylevision looks to have good support for creating the stylesheets but I haven't used it myself. Might be worth a look.

Altova StyleVision's Word XSLT support

Simon Collins
A: 

i also want to ask

astring
Then upvote the question.
infamouse
A: 

I believe Microsoft intends you to do one of the following things:

1) Have your tool output / manipulate RTF files, which can then be read in by Word 2007.

2) Programatically invoke Word to create the document itself, using its automation API.

I don't think the file format itself is something they generally expose the API to.

Colen