Reader Level:
Articles

Windows Forms 2.0 ActiveDocumentHost Control

By Mahesh Chand on November 10, 2005
The ActiveDocumentHost control provides the ability to host OLE Documents within your application. This enables you to create applications that allow in-place editing of documents such as Microsoft Word and Excel.
  • 0
  • 0
  • 19165
Download Files:
 

The ActiveDocumentHost control provides the ability to host OLE Documents within your application. This enables you to create applications that allow in-place editing of documents such as Microsoft Word and Excel.

To add an ActiveDocumentHost control to your form, just drag the ActiveHostDocument control from Toolbox to the Form and it will launch Insert Object dialog, where you can specify which OLE Document you want to use. See Figure 1.

ActiveDocumentHost1.jpg

Figure 1. Insert Object dialog.

For instance I select Microsoft Office Excel Worksheet. See Figure 2.

ActiveDocumentHost2.jpg

Figure 2. Selecting Microsoft Office Excel Worksheet

Now I resize the form and control and run the application. When I click on the control, it launches Excel spreadsheet where I can type whatever I want. All menu options of Excel are also available so you can save the contents as well.

ActiveDocumentHost3.jpg

Figure 3. ActiveDocumentHost in action.

I think this is a pretty useful control to have.

Mahesh Chand

Mahesh Chand is founder of C# Corner. C# Corner founded in 1999 is a FREE member contributions based open platform for developers to solve problems, learn new technology and hang out.  Mahesh has been awar... Read more

COMMENT USING

Trending up