Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello All,
I’m failing to display a WORD document properly in either a webBrowser or Rich Text Box control on a Windows form, in C#. The objective is to display a document, read only, with scroll bars so a user can confirm that they have the document they want. I can’t use a 3rd party add-on.

The same form has overlapping controls to display text, images, PDF and EXCEL, switched on and off with their Visible property. They all work nicely, including the EXCEL Interop piece. But, Word is a different deal. I can display a poorly formatted WORD document in the rich text box, as long as there is no image involved. This will actually do, but I’d much rather things look good.

I tried a webBrowser control, and it works in that the output is properly formatted, but isn’t displayed in the webBrowser control on the Windows form. It comes up behind my form in a new and separate IE page. The webBrowser control on the Windows form may, or may not, display a “Navigation to web page was cancelled” message, depending on current properties settings. Tried URL/URI, Preview, etc. to no avail.

Can this be easily solved? I’ll bet I’ve got a month into this.

Thank you for your time.
John Malcosky
Posted

1 solution

Do give this one a try, Word Control for .NET[^]. It will preview the Word documents in a Win Forms application.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900