Hosting Office in .NET applications

If you are building a .NET application and you are struggling to find a way to host Word documents, Excel spreadsheets, Visio drawings, Project files, or PowerPoint presentations, you might consider using the Visual C++ ActiveX Control for hosting Office documents. I learned about this download resource and I was shocked to see how you can add it to your solution and start working with Office applications in less than a minute. You can open Office applications, format content, update documents, save changes, print, and more inside your application. The Office Framer Control is an Active X control written in C++. The download includes source code to extend the functionality and sample code to use it inside Visual Basic 6 and HTML pages. You can also enable and disable specific functionality by using a full set of properties, methods, and events exposed for customization.

You can also host the control inside managed applications following these simple steps:

  1. Download and install the Office Framer Control 1.2 Sample.
  2. Start Visual Studio .NET. 
  3. Open your WinForms or WebForms application.
  4. Add the DSO Framer Control to the Toolbox: 
    • On the Tools menu, click Customize Toolbox (in Visual Studio .NET 2002), or click Add/Remove Toolbox Items (in Visual Studio .NET 2003), and then click the COM Components tab. 
    • On the COM Components tab, select DSO Framer Control Object. 
    • Click OK to close the Customize Toolbox dialog box.
  5. Select the DSO Framer Control icon that appears in the ToolBox and drag-and-drop the control over the Form or Web Form.
  6. Adjust the control’s docking/size as needed.
  7. Build and run the application.
  8. Create a new document to test the control.

I have to warn you that the control is not supported, the control and the source code is provided AS-IS for customization. However, you still can extend the functionality and it does the job, so have a peek and enjoy!