Topaz Filer: if you use e-mail for business, we can save you money and decrease your risk.
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
Reply to this message...
Vote that this is a GOOD answer...
 
 
    
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
Reply to this message...
Vote that this is a GOOD answer...
 
Auto-following on Twitter
Ubuntu and XP on one “desktop”
 
 
System.IO.StreamReader
System.Windows.Forms.Form




Ad
BootFX
Reliable and powerful .NET application framework.
Recession Busting Bespoke Software
Get through the recession by investing in bespoke software to decrease costs and create commercial opportunities.
Other DN247 Network Sites
.NET 247
SQL Server Wins
Old Skool Developer
 
Copyright © AMX Software Ltd 2008-2009. Portions copyright © Matthew Baxter-Reynolds 2001-2009. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - .NET 247 is a member of the DN247 Network - 4.0.30129.1734