views:

213

answers:

3

Does anyone know of any component or library (preferably open source) that would allow me to convert Word 2007 documents to Word 2003 with ASP.NET?

+1  A: 

Could you instead install (or have your users install) the Microsoft Office Compatability Pack? This allows Word 2003 to open documents saved by Word 2007 in both binary (.doc) and XML (.docx) formats.

If you have a stream of 2007 documents arriving at your company then maybe you could write a Word 2003 Add-In that uses a FileSystemWatcher to monitor a folder in which the files get placed. It would then open and re-save the files to a new location, in 2003 format.

Richard Ev
Thanks for the reply Richard. I actually thought about that once before, but the company I work for is huge, and getting something like that deployed across the enterprise is painful. :)
Kevin Adams
@Kevin: Fair enough. I updated my response with an additional suggestion.
Richard Ev
+1  A: 

To use Visual Studio Tools for Office (VSTO) you need to install Office 2007 on server.

Microsoft.Office.Tools.Word.Document.SaveAs

public virtual void SaveAs (
    [OptionalAttribute] ref Object FileName,
    [OptionalAttribute] ref Object FileFormat,
    [OptionalAttribute] ref Object LockComments,
    [OptionalAttribute] ref Object Password,
    [OptionalAttribute] ref Object AddToRecentFiles,
    [OptionalAttribute] ref Object WritePassword,
    [OptionalAttribute] ref Object ReadOnlyRecommended,
    [OptionalAttribute] ref Object EmbedTrueTypeFonts,
    [OptionalAttribute] ref Object SaveNativePictureFormat,
    [OptionalAttribute] ref Object SaveFormsData,
    [OptionalAttribute] ref Object SaveAsAOCELetter,
    [OptionalAttribute] ref Object Encoding,
    [OptionalAttribute] ref Object InsertLineBreaks,
    [OptionalAttribute] ref Object AllowSubstitutions,
    [OptionalAttribute] ref Object LineEnding,
    [OptionalAttribute] ref Object AddBiDiMarks
)

You need to specify custom FileFormat from WdSaveFormat enumeration.

I didn't found how to force exatly old, 2003 format but you can save it in RTF (WdSaveFormat.wdFormatRTF)

abatishchev
+1  A: 

Just as a followup, I was given the go-ahead to use Aspose.Words for .NET. I appreciate your comments and suggestions to this question. Thank you!

Kevin Adams
You can go ahead and mark your answer as the best answer with the hollow check mark next to this.
Otaku