tags:

views:

1191

answers:

2

I would like to load a Word or Excel document into a window of a WPF application so that users can view or edit the document within the application. Is there any way to achieve that?

+1  A: 

Hi,

You add web browser control from toolbox and the load word document in it. Even you can opend any document that browser support e.g. word, excel, pdf and swf etc...

Example Load Word webBrowser1.Navigate("C:\word.doc");

Example Load Excel webBrowser1.Navigate("C:\excel.xls");

Hope this help.

Armen Mkrtchyan
WebBrowser is fine, but it has two problems1. For office 2007, the default behavior is to load the document in its own instance, this loses the meaning of integrate into the WPF application.2. The WebControl will prompt users to open or save. This is annoying too.I actually found a ActiveX component will hosts Office application in WinForm or WPF without the above mentioned problems. But it is a paid component. http://www.ocxt.com/
intangible02
A: 

SpreadsheetGear for .NET comes with a .NET Windows Forms control which can easily be used in WPF applications to view and edit Excel documents.

You can download a free trial here if you want to try it yourself.

Disclaimer: I own SpreadsheetGear LLC

Joe Erickson
I will definitely take a look.
intangible02