• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 967
  • Last Modified:

Display Word document on a Windows form

Is there a way to display a word document on a windows form and make it uneditable?

I am using Visual Studio 2008
0
YZlat
Asked:
YZlat
1 Solution
 
YZlatAuthor Commented:
it's an old link and the link on that forum is broken
0
 
Jacques Bourgeois (James Burger)Commented:
Not directly, there is now way that I know to load a .doc or .docx in .NET.

There used to be an OLEControl in VB6 that could do that, but even there, it was not always working well. It seems that they never were able to do one in .NET. COM (on which Word is based), is too different from .NET.

However, you could write code to save the document as .rtf and reload the generated .rtf into a RichTextBox control. You need to have a copy of Word installed on the computer however to do so.

Expect to lose a few things in the formatting however, specially if you work with .docx files, because .rtf cannot display everything that a Word document can at a high level. As an exempla, things such as diagonals in table cells do not translate to .rtf files.
0
 
YZlatAuthor Commented:
I've decided to take a different route but your suggestion was the best answer I got
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now