tags:

views:

774

answers:

3

Hi All,

I need to convert Word Document to XML and back once editing has been performed on it.

I don't have Microsoft Office Installed at my server, and I want my users to edit their documents via Web Browser.

I am using C# and ASP.Net

Thanks

+1  A: 

I believe the latest version of Microsoft Word (and Excel) already save files in XML format, hence the .docx and (.xlsx) extensions. Hope that suffices your need.

Alternatively, you could see if they are tools to convert the old .doc format files to .docx which should, as a result, provide you with a XML based word file.

Kyle B.
Yep, but they are also compressed (rename them to .zip and you can get at the XML) - so you'll need to unzip them first, modify the XML, and then re-compress them.
Zhaph - Ben Duguid
In Word 2007, do save as .xml; that gives you a "Flat OPC" xml file which you can edit, save and re-open in Word, without all the zip/unzip hassle.
plutext
+1  A: 

So you have a couple of options here:

1) Use OfficeWriter from SoftArtisans. This allows you to crack open the binary office file format(e.g. .doc and .xls) note:I am biased because my company makes this product but I think it's awesome.

2) If you can use the newest file format (.docx and .xlsx) you can use the SDK that microsoft has released that will do all of that uzipping rezipping nonsense for you. (called the opem XML SDK)

Ben Jones
A: 

What XML do you want to convert to?

Try using Aspose.Words for .NET.

romeok