Click here to Skip to main content
13,145,603 members (34,389 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How to open the word document as MdI child to mdi Parent form in C#
Posted 19-Nov-12 5:11am
Sergey Alexandrovich Kryukov 19-Nov-12 12:04pm
Tag: "Forms".

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

There is no a public component ready-to-use component to render Word document I'm aware of. This is very unlikely, because Word is a proprietary application. In general, I think that the numerous questions about Word reflect non-developer's approach to the problem, but the approach of plain computer uses still not understanding well who is who. It would be much better to use documents of other types, such as Microsoft Flow Document, HTML or the like.

There are some written in C++, a part of LibreOffice/OpenOffice. If you only need to render the document on screen, in principle you can use C++ code through P/Invoke. Or you can implement .NET components from scratch, but it will be a huge work. However, this is quite possible if you want to use newer Microsoft Office XML-bases format, because it is standardized under ECMA-376:[^],[^],[^].

Alternatively, instead of fully-fledged implementation, you can parse Office document, map it so some other document structure, without one-to-one correspondence, and render it. This approach is typical on some Web sites, with Office<—>HTML mapping — for example, look at career sites. (And for Forms, CodeProject has a wonderful "secret weapon"! — see this article: A Professional HTML Renderer You Will Use[^].)

See also my past answers:
Convert Office-Documents to PDF without interop[^],
Hi how can i display word file in windows application using[^].

And finally, let me note on MDI. Here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don't. Please see:[^],
How to Create MDI Parent Window in WPF?[^].

I can explain what to do instead. Please see my past answers:
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to set child forms maximized, last childform minimized[^].

Abhishek Pant 19-Nov-12 12:38pm
my 5! Excellent advice-Got important links from above,thanks Sergey
Sergey Alexandrovich Kryukov 19-Nov-12 14:12pm
Great, thank you, Abhishek.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 30 Sep 2015
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100