Host Microsoft Office Application in .NET

If you are building a .NET application and you are struggling to find a way to host Word documents, Excel spreadsheets, PowerPoint presentations, Visio drawings orProject files, 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 EDraw Office Viewer Component is an Active X control written in MFC. The download includes some sample codes to use it inside Visual Basic, HTML pages, C#, Asp.NEt. 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. Downlad the EDraw Office Viewer Component.
2. Open Visual Studio .NET. 
3. Open your WinForms or WebForms application.
4. Add the EDraw Office Viewer Component to the Toolbox: 
5. On the Tools menu, click Customize Toolbox (in Visual Studio .NET 2002), or click Add/Remove Toolbox Items (in Visual Studio .NET 2003 or 2005), and then click the COM Components tab. 
6. On the COM Components tab, select EDraw Office Viewer Component. 
7. Click OK to close the Customize Toolbox dialog box.
8. Select the EDraw Office Viewer Component icon that appears in the ToolBox and drag-and-drop the control over the Form or Web Form.
9. Adjust the control’s docking/size as needed.
10. Build and run the application.
11. Create a new document to test the control.
12. You can call more than one hundred methods to customize your application.

Edraw Office Viewer Component Version 5.1 Released

Edraw Office Viewer Component version 5.1 released yesterday. New version provides more than one hundred methods. Now you can do some office automation with our component directly. You can open and play the slideshow in a customize form. You can create a new excel workbook then fill in the sheet with the data from your database. You can limit the user to edit or print the Word document by setting the readonly mode.

Now the new version supports both the HTTP and HTTPS. It also supports the website with password. Of course you can upload or download the file via FTP too.

What’s new

1. Support HTTP/HTTPS and the website with the password.

2. You can set the Readonly mode for both Word and Excel.

3. You can play the slideshow in the same window without the web toolbars and the scrollbar.

4. Now it’s no problem to open the hyperlink in the office document.

5. Now it’s no problem to play the media, animation, vedio in the PowerPoint slide file.

6. Support Both Print and PrintPreview. You can enable or disable them too.

7. You can put multiple office programs in a form or open multiple EDraw Office Viewer Component instances in the internet explore.

8. Insert the image, text, html, rtf to your Word document with the office automation interfaces.

9. More setting for rulers, gridlines, toolbars, menubars, titlebar, caption and color scheme.

10. Suport the clipboard operator. You can insert the data into the Word or Excel from the clipbard.

Embed Office

Do you want to embed a desktop application with Microsoft Office integration such as Word, Excel and Powerpoint, PDF etc? Do you want to display Word, Excel and Powerpoint document in your web application? Do you want to host office documents in your Winforms program? All these things now can be easily achieved by using Edraw Office Viewer Component.

The component supports seamless integration with Office 97, 2000, XP, 2003 and 2007.

Edraw Office Viewer Component support embeding 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.

Office Viewer Component Features

1. Read-Only embedding Word document and Excel Sheet! It is a great solution for companies wishing to display read-only Word document data and Excel sheet to their employees while restricting modifications to the underlying data.
2. Support seamless integration with Office 97, 2000, XP, 2003 and 2007.
3. Play SlideShow at the same window. You can embed PowerPoint in the same window or full screen mode.
4. You can also embed password protected Word documents without supplying passwords to your users – keep your confidential data safe and secure!
5. HTTP/HTTPS Support. With the office OCX it is easy to upload or download file between server and client via HTTP/FTP.
6. Support More file types. You can open all the file formats supported by Microsoft Word such as doc, docx, dot, rtf, txt, mht, xml, wps, wri, wpd, wps, wpi, olk, pab. You can also open the follow file in the Microsoft Excel sheet such as xls, xlsx, xlt, xlw, cvs.
7. Multiple Language Support. Easy to modify the interface in run time/design time.
8. Support Office Automation by exposing the active document interface. Enable the developer to customize the office application by the dispatch interface.
9. Easy to use with a lot of examples provided.

It is a standard ActiveX control that can be used as an ActiveX document container. It can be easily integrated into applications written in languages that support ActiveX control such as Visual C++, Visual Basic, Delphi, C++ Builder, .Net languages (VB.Net, J#, C#), eDeveloper, and web pages with Internet explorer.

Edraw Office Viewer Component for Hosting Office Documents

Edraw Office Viewer Component contains a standard ActiveX control that acts as an ActiveX document container for hosting Office documents (including Microsoft Word, Microsoft Excel, Microsoft PowerPoint, Microsoft Project, and Microsoft Visio documents) in a custom form or Web page. The control is lightweight and flexible, and gives developers new possibilities for using Office in a custom solution.

The control is designed to handle specific issues that make using ActiveX documents from a non-top-level host window difficult, and serves as a starting place for constructing your own embedded object file viewer or editor as an ActiveX control.

It is a great solution for companies wishing to display read-only Word document data and Excel sheet to their employees while restricting modifications to the underlying data. You can play the powerpoint file in the same window. You can also display password protected Word documents without supplying passwords to your users – keep your confidential data safe and secure! With the office ocx it is easy to upload or download file between server and client via HTTP/FTP.

MORE INFORMATION
This component shows allows developers to embed Office files for in-place editing and viewing. It can be easily integrated into applications written in languages that support ActiveX control such as Visual C++, Microsoft Internet Explorer, Visual Basic, Delphi, C++ Builder and .Net languages to view Office files inside their main solution, and give them programmatic control over the document while it is embedded. 

Solved Boundary Errors When Upload a File with Office Viewer OCX

It’s important to solve the boundary errors when uploading a file to a server via HTTP. Now EDraw Office Viewer Component has changed the upload method and added a boundary process for the uploaded file and parameter.

The boundary error could be exploited by remote attackers to cause a denial.  EDraw suggests all the user updated to the latest version if they are developping a web application with the office viewer ocx but they have the vulnerable server.

dsoFramer replacement

I’m using the office viewer activex control. I have spent lots of time in solving the bug of dsoframer. It is originally developed by Microsoft as a C++ ActiveX control sample to host/embed ms-office documents (download here). But unfortunately it also have several bugs:

1. The title of the host application will go garbled when the control is disposed.

2. Event can not be fired correctly when embedded directly in a winform control.

3. Events can not be fired when wrapped in a C# user-control.

4. Call DSOFramer to handle word in IE cause IE crash.

5. Word 2007 files will be deleted after saving.

6. Files are locked so the upload action will always fail.

Can not start a separate office process to handle the documents if there is already an existing one. For destop application, this may lead to miscellaneous bugs such as: no response of toolbar, can not start office externally after control is initialized, redo/undo influence all the instances instead of the active one, etc.

Edraw Office Viewer Component V7 help you host MS Office and there are not these above headachy problems. It is more steady than the dsoframer and has more automation functions.

What’s New in Edraw Office Viewer Component

1. Faster new and open speed.
2. Supports office 2010.
3. New version invokes the Office Ribbon menu. The developer can enable it or disable it by requirement.
4. Supports to open multiple Word, Excel, PowerPoint Instances in the different form or the IE tab.
5. Solves the toolbar disable issue when open a word instance outside of the component.
6. Solves the word menu flicker in the IE 7 and IE8.
7. Added the method to disable the view right click menu.
8. Allows to disable the save, print and copy hot key in the MS Word document (includes the F12 hot key).
9. Invokes the Word event and Excel event in the component.
10. Supports to open the office 2007 files in Office 2003 with 2007 compatibility package installed.
11. Supports to open the password and write password protected word document.
12. Addes the protect type to allow only revisions or full protection.
13. Fixes the bug which Word cannot create the work file: check environment temp variables when Vista UAC enabled.

The DSOFramer deletes the Word file when saves

Word 2007 File Seems To Be Deleted When You Open And Save It Using DSOFramer.

If you are using DSOFramer sample to host Office Documents, whenever he tried to open and save Word 2007 documents in this manner, guess what !! the file seems to be deleted !

Because the DSoFramer are moving the file to a temporary directory and then while saving it we are saving the changes in it.  Mostly you will lost the files if you are using Word 2007.

These don’t occurs in EDraw Office Viewer Component.