Display a word document in a Windows program without Word

  • Thread starter Thread starter Mufasa
  • Start date Start date
M

Mufasa

I need to write a windows program in C# that will display a word document on
the screen without having Word loaded on the machine.

How can I do this?

TIA - J.
 
I need to write a windows program in C# that will display a word
document on the screen without having Word loaded on the machine.

How can I do this?

If you do not have Word installed on the machine, and the program must
be one of your own creation, then you'll have to read the DOC format
and render it just like MS Word or MS Word Viewer does. There is open
source software that you can study (in other languages) to see how it
is done; you can even look at the source code to OpenOffice.org, which,
IIRC, is done in C++.

Would not the free Word Viewer do what you need, though?

http://www.microsoft.com/downloads/...87-8732-48D5-8689-AB826E7B8FDF&displaylang=en

--- Mike
 
I will be calling this from a program and my understanding is that when you
use the viewer it automatically opens the document in another window. I want
to be able to have it as part of the window I already have open.

J.
 
I will be calling this from a program and my understanding is that
when you use the viewer it automatically opens the document in
another window. I want to be able to have it as part of the window I
already have open.

Alright, well, if you have the time to do it, then.

Without having MS Word present, you won't be able to use Word's API to
create a document programmatically or to read the document using the
API Microsoft gives. I don't believe that the API would be exposed by
the free Word Reader, either. And it'd seem that even so, Word opens
the document in its own window when you ask it to open it.

So, you'll have to implement a class library to open and view the Word
document.

There is a decent amount of code under GPL and LGPL that you can study
for your implementation of a Word document reading library. It will
likely take you a while. OpenOffice.org is available under the terms
of the LGPL, so you can probably port its Word file handling code to
your C# code base and use that. Then you'll need to render it.

--- Mike

--
My sigfile ran away and is on hiatus.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEAREDAAYFAkj4yZgACgkQ0kE/IBnFmjDpAACeMdce9Fi4FGFoZ2i/c242H+dE
j5IAnisWtua0+TjlvVR+P7+jgJiNtdVx
=1bbw
-----END PGP SIGNATURE-----
 
You will need to use a third party component such as Aspose ,
http://www.aspose.com/, if you want it embeded in your form.


Mufasa said:
I will be calling this from a program and my understanding is that when you
use the viewer it automatically opens the document in another window. I
want to be able to have it as part of the window I already have open.

J.
 
Back
Top