Open or preview a word document in a c# MDI windows form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, there,

1. I would like to open a word document in a MDI environment. Every time, a new window outside my MDI poped out and show the word document. Is there a method I can use to specify the showing window? And how to?
2. Is there a way to preview the word document, other than load it fully?
3. How to extract all the characters in Unicode from this word document?

Thanks lot in advance!

Gary
 
Gary said:
1. I would like to open a word document in a MDI environment.
Every time, a new window outside my MDI poped out and show the word document.
Is there a method I can use to specify the showing window? And how to?

Hi Gary,

you can host the Word-document on a Windows.Forms.Form by using IE:

How To Use the WebBrowser Control to Open Office Documents with Visual
C# .NET
http://support.microsoft.com/?id=304662

or you can take an ActiveX-Control that hosts Office-documents and use
it through COM/interop.

SAMPLE: Visual C++ ActiveX Control for Hosting Office Documents in
Visual Basic or HTML
http://support.microsoft.com/?id=311765
2. Is there a way to preview the word document, other than load it fully?

The pre-built preview file is located in the compound document structure
of the word document which can be read by using the dsofile.dll which is
a COM-dll but it works through COM/interop:
[DSOleFile.DocumentProperties.Thumbnail]

http://support.microsoft.com/?id=224351
3. How to extract all the characters in Unicode from this word document?

Perhaps by simply temporarily saving the Word-document in text-only format

doc.SaveAs("fileName.txt, WdSaveFormat.wdFormatUnicodeText, ...) and
reading it again by using StreamReader?

Cheers

Arne Janning
 
Back
Top