views:

104

answers:

2

Hi,

I would like to know whether its possible to open Open word 2003 (doc) file using open xml file format API? like office 2007.

I have one windows service through which I am trying to open and edit doc files but getting lot of problems.I have posted question regarding that problem here but got no answer.

After lot of googling, I came across this page which tells about microsoft recommendations of Office automation on server-side code. Microsoft suggests that office automation should not be implemented in server-side code,as office applications are made for interactive client workstations. This page does not tell if its possible and how to open doc files using open xml format API.

Basically, I want one windows service which will take doc file as an input, open it, edit it and save it. How to achieve this?

My development enviornment : C#, .net 2.0 framework, Windows Vista, Office 2003

+1  A: 

You can't. Microsoft introduced office open xml standard from Word 2007. Word 2003 uses binary format.

Simon
@Simon, Thanks.
Shekhar
+2  A: 

I think you might be missing the point of Office interop. Using Office interop basically means you communicate with a running Microsoft Office Word/Excel process and manipulate a document/spreadsheet in a defined manner. There is no need to directly modify a word document itself if you use Office interop.

If you wish to modify an Office .doc document directly without the presence of Microsoft Office, then your best bet would be to Google for a library that will directly manipulate .doc for you, although these libraries tend to be fairly buggy, and where they aren't buggy, they're expensive.

EDIT: If you're asking whether or not you can use Office 2007 interop to manipulate a .doc file, then the answer is yes.

Sam Day
@Sam, thanks.. If we want to open and edit doc files from windows service, what is the best way? I want one windows service which will take doc file as an input, open it, edit it and save it. How to achieve this?
Shekhar
Well I'm not sure what language you're using, but a good place to start is http://msdn.microsoft.com/en-us/library/15s06t57.aspx and http://msdn.microsoft.com/en-us/library/kw65a0we.aspx.
Sam Day
Thank you very much Sam.
Shekhar