PC Review


Reply
Thread Tools Rate Thread

Display a word document in a Windows program without Word

 
 
Mufasa
Guest
Posts: n/a
 
      14th Oct 2008
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.


 
Reply With Quote
 
 
 
 
Michael B. Trausch
Guest
Posts: n/a
 
      14th Oct 2008
On Tue, 14 Oct 2008 13:52:59 -0400
"Mufasa" <(E-Mail Removed)> wrote:

> 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/d...displaylang=en

--- Mike

--
My sigfile ran away and is on hiatus.

 
Reply With Quote
 
Mufasa
Guest
Posts: n/a
 
      17th Oct 2008
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.

"Michael B. Trausch" <(E-Mail Removed)> wrote in message
news:20081014142835.5755b22e@zest...
> On Tue, 14 Oct 2008 13:52:59 -0400
> "Mufasa" <(E-Mail Removed)> wrote:
>
>> 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/d...displaylang=en
>
> --- Mike
>
> --
> My sigfile ran away and is on hiatus.
>



 
Reply With Quote
 
Michael B. Trausch
Guest
Posts: n/a
 
      17th Oct 2008
On Fri, 17 Oct 2008 13:03:08 -0400
"Mufasa" <(E-Mail Removed)> wrote:

> 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-----

 
Reply With Quote
 
Mel Weaver
Guest
Posts: n/a
 
      17th Oct 2008
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.
>
> "Michael B. Trausch" <(E-Mail Removed)> wrote in message
> news:20081014142835.5755b22e@zest...
>> On Tue, 14 Oct 2008 13:52:59 -0400
>> "Mufasa" <(E-Mail Removed)> wrote:
>>
>>> 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/d...displaylang=en
>>
>> --- Mike
>>
>> --
>> My sigfile ran away and is on hiatus.
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to have a Windows program that opens a word document for read only. Mufasa Microsoft C# .NET 0 10th Oct 2008 07:25 PM
Word 2007 Preview Pane does not Display a MS Word Document Jeff V. Pulver Microsoft Word Document Management 1 30th Apr 2008 10:52 PM
Re: How do I prevent Word using windows colors for document display? Tony Jollans Microsoft Word Document Management 0 7th Jan 2007 06:18 PM
Document edited with MS word-2003; MS-word crashes if that document is opened with older MS word versions qazmlp Microsoft Word Document Management 2 27th Apr 2005 07:11 AM
MS Word document crashing Word program Robin Windows XP Help 2 1st May 2004 04:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:17 AM.