Host Office Like OLE - Hosting Word, Excel, PowerPoint in Application.

> Edraw Tip > Host Office Like OLE - Hosting Word, Excel, PowerPoint in Application.
author
Posted by James Freeman |
Office Viewer Component allows developers to host Word, Excel, PowerPoint Like OLE in application. Not extend office out of the application.

The component supports seamless integration with Office 97, Office 2000, Office 2003, Office 2007 and Office 2010.
Edraw Office Viewer Component supports embedding Office documents in your application by implementing a full featured ActiveX document container. Now you can create, open, edit, view and save office documents such as *.doc, *.docx, *.xls, *.xlsx, *.ppt, *.pptx etc. in your own program's window. With Office component you can have Office run embedded inside your custom solution.

Download Office Viewer Component and View Sample Projects

Host Office Like OLE

Figure 1: Hosting and Displaying Word, Excel Documents.

Host Microsoft Office in VC

You can use Edraw Office Viewer Component like other standard ActiveX Control. Firstly, you can create a dialog or form view. Then insert the Office ActiveX control to project. Drag it to the form. Change the form property to Clip Children.

clip children

Right click the Office ActiveX Control. Then choose the Add variable... In the pop up dialog you can add the variable name and press OK button.

The edoffice.h and edoffice.cpp wrapped class will be added to your project by the VC class wizard.

If you want to change the size of the component, you can overload the OnSize method.

void CVCEDOfficeDemoView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
if(m_edoffice)
m_edoffice.MoveWindow(0,0,cx,cy);
}

Host Office Component in ASP.NET Project

Edraw Office Viewer Component is a client ActiveX Control. So you can not add the component in the server component toolbox. Only use it as the html object. Then you can use these wrapped methods or event by javascript or vbscript code.

How to add Edraw Viewer Component to your ASP.NET project

1. Open Visual Studio.
2. Create a new ASP.NET project.
3. Do not attempt to add the Edraw Viewer Component to the Toolbox. It is a client component. You can add it as the HTML Object.
4. Copy all files at the install folder\ASP.NET\ to your project folder. ( UploadAction.aspx, UploadAction.aspx.cs, Default.aspx.cs, Default.aspx)
5. Then add exist items...
6. Modify the Server Port in the Default.aspx.
6. Run.

Embedding a Word Window in VB Project

1. From the Project Menu, select Components
2. Select control "Edraw Office Viewer ActiveX Control Module" in the controls table
3. Click the OK Button
4. The control will now appear in your toolbox
5. Drag and drop the control on your form

Host Office Component in C#.NET or VB.NET project

1. Open .NET
2. Right-click on the toolbox and select "Choose Items"
3. Select the COM Components Tab
4. Check "Edraw Office Viewer Component" and click OK Button
5. The control should appear in the toolbox as "Edraw Office Viewer Component"
6. Double-click on the control to add to your form
7. Resize and move the control on the form as desired
8. Add a button to the form
9. Double-click on the button to access code editor and enter the following code within the Click event: Note: Modify code to point to an existing document file on your web server
10. EDOffice.Open " https://www.edrawsoft.com/demo/samples/sample.xls"
11. Run the application and click on the button

Host Microsoft Office Document in a Java Frame

Microsoft Office documents (including Word, Excel, PowerPoint, Project, and Visio documents) are ActiveX Document servers, not ActiveX Controls. Visual Basic does not support a native control to host ActiveX Documents. Instead, Visual Basic uses the OLE container control to embed an ActiveX Document. Therefore you cannot directly embed ActiveX Documents in a Java frame either. Alternatively, you can use Edraw Office Viewer Component to host Office document. The component is a standard ActiveX control and enhanced solution for OLE container. Only insert the component in your project as other ActiveX control. The Office Viewer Component wrapped and exposed some common used methods and events of Microsoft Office ActiveX document and the Java code will be able to access those wrapper methods that talk to the original methods of the Word and Excel ActiveX document.

Use the Wrapper Methods to Automating Office

Disables MS Word Standard Command

Disable Office Ribbon Button

Show/Hide Office Menu Bar

Integrate MS Office in Delphi Program

Embed Office in C# and Do Office Automation

Online Office Document Viewer

Embed MS Office in WPF Program

download EdrawMind
main page

Get Started! You Will Love This Easy-To-Use Diagram Software

EdrawMax is an advanced all-in-one diagramming tool for creating professional flowcharts, org charts, mind maps, network diagrams, UML diagrams, floor plans, electrical diagrams, science illustrations, and more. Just try it, you will love it!