|
| Open or preview a word document in a c# MDI windows form |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.languages.csharp.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| Gary (VIP) |
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
|
|
|
| |
|
|
| |
| |
| Arne Janning |
Gary wrote: [Original message clipped]
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
|
|
|
| |
|
| |
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|