Edraw Office Viewer Component V7.5.0.357 Released

 

Office Viewer Component

Edraw Office Viewer Component Acts as an ActiveX document container for embeding Office documents (including Microsoft Word, Microsoft Excel, Microsoft PowerPoint) 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.

Download link: http://www.ocxt.com/download/OfficeOCXSetup.exe

Online Demo: http://www.ocxt.com/online-demo

Free download Office Viewer ComponentPurchase Office Viewer Component in a promotional price

You can find the sample projects and help document in the install folder. Learn More

Edraw Viewer Component for Word V7.4.0.357 Released

word viewer

Edraw Viewer Component for Word is the enhanced solution of office viewer and focus in the Microsoft Word. The word 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 word object file viewer or editor as an ActiveX control.

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

It can be easily integrated to the modern integrated development environments like Visual C++, Visual Basic, C# or VB.NET, Acess, ASP.NET, Visual FoxPro, Delphi, PowerBuilder, and more.

Download link: http://www.edrawsoft.com/download/EDWordSetup.exe

Online Demo: http://www.ocxt.com/online-demo

Free download Office Viewer ComponentPurchase Office Viewer Component in a promotional price

The new component has also solved some known bugs in the previous version.

What’s New:

1. Supports to open multiple Word Instances in the different form or the IE tab.

2. Solved the toolbar disable issue when open a word instance outside of the component.

3. Solved the word menu flicker in the IE 7 and IE8.

4. Enabled more Word functions and buttons.

5. Added the method to disable the view right click menu.

6. Allows to disable the save, print and copy hot key (includes the F12 hot key).

7. Invoked the Word event in the component.

8. Supports to open the docx file in Word 2003 with 2007 compatibility package installed.

9. Supports to open the password and write password protected word document.

10. Added the protect type to allow only revisions or full protection.

11. Added the bookmark and revision operations.

12. Added the method to disable drag and drop function in the MS Word.

Edraw Viewer Component for Excel V7.4.0.357 Released

Excel Viewer Component

Edraw Viewer Component for Excel is the enhanced solution of office viewer and focus in the Microsoft Excel. The excel 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 excel object file viewer or editor as an ActiveX control.

Download link: http://www.edrawsoft.com/download/EDExcelSetup.exe

Online Demo: http://www.ocxt.com/online-demo

Edraw PDF Viewer Component V3.2.0.355 Released

PDF Viewer Component

PDF Viewer Component is a light weight ActiveX Control which enables your application to display and interact with PDF files. It is identical to Adobe Reader program and adds high speed viewing of PDF documents to your applications easily. Read-Only Support for PDF Viewer! It is a great solution for companies wishing to display read only PDF document to their employees while restricting save or save to the underlying data. The control is lightweight and flexible, and gives developers new possibilities for using PDF Reader in a custom solution.

Free download PDF Viewer ComponentPurchase PDF Viewer Component in a promotional price

Online Demo: PDF Viewer Component Online Demo
Download Printable Develop Manual

PDF Viewer Component Features

  1. Seamlessly use the Adobe Reader as the container to render the PDF files. 100% PDF format compatible.
  2. HTTP/HTTPS Support. With the component it is easy to upload or download file between distant server and client via HTTP/FTP.
  3. Show/Hide the Save Copy As button which is available in adobe tool bar.
  4. Show/Hide the PDF Print button in adobe tool bar.
  5. Show/Hide the scrollbar in PDF viewer.
  6. Disable the right-click menu in adobe reader window.
  7. Disable all the hot keys such as Save As, Print, Show/Hide Tool Bar and more.
  8. The document control represents the PDF document and lets you open, close, save, print and
    navigate the PDF document programmatically. Support all the interfaces of Adobe PDF Reader such as zoom, search and navigate.
  9. A standard ActiveX control which can be called from different programming languages, including C/C++, C#, Delphi, Visual Basic, ASP.NET etc.
  10. Requires any edition of Adobe PDF Reader is included as part of the comprehensive PDF Viewer Component.

Host multiple Excel and Word components in a form

You can host multiple office component in a form or you can open multiple office instance in your internet explore with Edraw Viewer Component version 7.

The new version 7 has no toolbar-locked issues with multiple instances of Word or excel opened in several tabs or even inside single form.

Note: you need set the Frame hook policy as SetOnFirstOpen and Component activation policy as KeepUIActiveOnAppDeactive in the previous version. But it doesn’t work for the IE7 or IE8.

Frame hook policy
To correctly handle activation when the host gains or loses foreground status, the ActiveX control uses a frame hook. By default, the hook is set when the control is created. In some situations, especially when the control is used from a multi-threaded UI host or when the control is nested in a container control like a Tab page in a .NET WinForm application, the parent of the control at create time may not be the correct window for the control to hook when it is running. In these situations, you can use the FrameHookPolicy property to reset the hook at a more suitable time. For example, if you build a .NET WinForm solution, set the FrameHookPolicy property to SetOnFirstOpen in the Properties window.

Component activation policy
The sample control can support more than one instance of itself in a given host application. However, only one control can be active at a given time. This is a requirement of ActiveX Document hosting. To handle multiple instances in a single host, the control registers itself with a component manager. This lets the component manager keep track of the active control. Use the ActivationPolicy property to control how the embedded object is handled during component changes. The ActivationPolicy property can be set to one or more of the bit flags that are defined by the ActivationPolicy enumeration.

Disable the Office Menu

Edraw Office Viewer Components can disable the office main button and protect the opened document was modified by the end users. Only call the DisableFileCommand method in the BeforeDocumentOpen event and set the different enumerates.

boolean DisableFileCommand([in] WdUIType UIType, [in]
boolean Disable);
UIType: The enum type need to disable in the UI. WdUIType.
Disable: True to disable the command button or menu item.
enum WdUIType
{
wdUIDisalbeOfficeButton = 0×00000001,
wdUIDisalbeNew = 0×00000002,
wdUIDisalbeOpen = 0×00000004,
wdUIDisalbeUpgradeDocument = 0×00000008,
wdUIDisalbeSave = 0×00000010,
wdUIDisalbeSaveAs = 0×00000020,
wdUIDisalbeSendAsAttachment = 0×00000040,
wdUIDisalbeClose = 0×00000100,
wdUIDisalbePrint = 0×00000200,
wdUIDisalbePrintQuick = 0×00000400,
wdUIDisalbePrintPreview = 0×00000800,
wdUIDisalbeSaveAsMenu = 0×00001000,
wdUIDisalbePrepareMenu = 0×00002000,
wdUIDisalbePermissionRestrictMenu = 0×00004000,
wdUIDisalbeSendMenu = 0×00008000,
wdUIDisalbePublishMenu = 0×00010000,
wdUIDisalbeServerTasksMenu = 0×00020000,
wdUIDisalbeCopyButton = 0×00040000,
wdUIDisalbeCutButton = 0×00080000,
wdUIHideMenuHome = 0×01000000,
wdUIHideMenuInsert = 0×02000000,
wdUIHideMenuPageLayout = 0×04000000,
wdUIHideMenuReferences = 0×08000000,
wdUIHideMenuMailings = 0×10000000,
wdUIHideMenuReview = 0×20000000,
wdUIHideMenuView = 0×40000000,
wdUIHideMenuDeveloper = 0×80000000,
wdUIHideMenuAddIns = 0×00100000,
wdUIHideMenuFormat = 0×00200000,
wdUIHideMenuEdit = 0×00400000,
wdUIHideMenuTool = 0×00800000,
}WdUIType;
Note: The component disabled the Office menu, New button and Open
button in default.
DWORD dwDisableCommand = wdUIDisalbeOfficeButton |
wdUIDisalbeNew| wdUIDisalbeOpen;
The function need be set in the BeforeDocumentOpened event.
If you want to enable the three button, follow the samples.
Example
The following vb script shows how to enable the office main menu, new button and open
button.
Sub DocumentOpenedEvent ()
Edword.DisableFileCommand 1 , false ‘wdUIDisalbeOfficeButton
Edword.DisableFileCommand 2 , false ‘wdUIDisalbeNew
Edword.DisableFileCommand 4 , false ‘wdUIDisalbeOpen
End Sub
SCRIPT FOR=OA1 EVENT= DocumentOpened ()
DocumentOpenedEvent()
SCRIPT
The following vb script shows how to diable the saveas and save button.
Sub DocumentOpenedEvent ()
Edword.DisableFileCommand 16 , true ‘wdUIDisalbeSave
Edword.DisableFileCommand 32 , true ‘wdUIDisalbeSaveAs
End Sub
SCRIPT FOR=OA1 EVENT= DocumentOpened ()
DocumentOpenedEvent()
SCRIPT

How to insert HTML table into Word doc using Javascript?

Use Edraw Office Viewer Component or Word Viewer Component to get the Document interface, then you can do it by the office automation.

document.OA1.CreateNew(“Word.Document”);
var objWord = document.OA1.ActiveDocument;
var range = objWord.Range(0,0);
var WTable = objWord.Tables.Add(range, 3,3);
WTable.Cell(1,1).Range.Font.Name = “Times New Roman”;

WTable.Cell(1,1).Range.Text = “examples 1″;
WTable.Cell(1,2).Range.Font.Size = 18;
WTable.Cell(1,2).Range.Bold = true;
WTable.Cell(1,2).Range.Font.Italic = true;
WTable.Cell(1,2).Range.Text = “examples 2″;
WTable.Cell(2,1).Range.ParagraphFormat.Alignment = 1; // 0= Left, 1=Center, 2=Right
WTable.Cell(2,1).Range.Font.Name = “Arial”;
WTable.Cell(2,1).Range.Font.Size = 12;
WTable.Cell(2,1).Range.Bold = false;
WTable.Cell(2,1).Range.ParagraphFormat.Alignment = 2;
WTable.Cell(3,3).Range.Font.Name = “Times New Roman”;
WTable.Cell(3,3).Range.Font.Size = 14;
WTable.Cell(3,3).Range.Bold = true;
WTable.Cell(3,3).Range.Font.Underline = true;
WTable.Cell(3,3).Range.ParagraphFormat.Alignment = 0;
WTable.Cell(3,2).Range.Text = “examples 3″

Embedding ms office in C# Forms

With Edraw Office Viewer Component, it’s easy to embed the ms office program in c# froms or html pages. Only drag it to your form, you can call some method to do the office automation directly such create a Word document or initialize an Excel sheet.

1. Download Edraw Office Viewer Component then install it. Or you can register the officeviewer.ocx using regsvr32 command.
  C:\\WINNT\System32\regsvr32 OfficeVidewer.ocx
2. On successful registration you would get message dialog.
3. Add Office Viewer Active-X control on your form through customize toolbox window.
4. Drag and drop component from toolbox on your form and resize as per requirement.
5. Now add reference for “Microsoft Word Object Library 11.0″ from add reference on solution explorer. Here I am using Word 2003, so object library version is 11.0.
6. You can see all added reference on solution explorer as shown in figure. Two reference has been added for Edraw Office Viewer  Component (AxOfficeViewer and OfficeViewer) and three libraries for Office & Word (Microsoft.Office.Core and Office and Word).
7. Define a variable for word document in public section of form as
   public Word.Document oDoc;
8. Add following code for button click event
private void button1_Click(object sender, System.EventArgs e)
{
     //Remove Office Viewer Component Title Bar and create a new Word document
     axOfficeViewer1.Titlebar = false;
     axOfficeViewer1.CreateNew(“Word.Document”);
     axOfficeViewer1.Activate();
     //Invoke Word properties
     oDoc = (Word.Document)axOfficeViewer1.ActiveDocument;
     oDoc.ActiveWindow.View.Type = Word.WdViewType.wdOutlineView;
     oDoc.ActiveWindow.DisplayRulers = false;
     oDoc.ActiveWindow.DisplayScreenTips = false;
     oDoc.ActiveWindow.DisplayHorizontalScrollBar = false;
     oDoc.ActiveWindow.DisplayVerticalRuler = false;
     oDoc.ActiveWindow.DisplayVerticalScrollBar = true;
}
10. Now you can add text, format it, send mail do all functionalities.
11. You can control all word functionalities to be made available or unavailable programmatically through code with all available objects, properties & Methods of word.

 

(Fixed) CloseDoc error in the V7.5.0.331

We are experiencing a problem with the Office Viewer component. We are using it embedded in a browser window (IE7). It is exhibiting some strange behavior under certain conditions.

These are the steps to reproduce:

If you open the browser window that has an instance of the office viewer on it, and use javascript to have the Office viewer open a word document
Have another instance of WORD open in “stand alone” mode and minimize it to the windows toolbar
While the first browser window is opening and loading the WORD document, press on the WORD toolbar icon, so it maximizes and displays on the desktop

If you get the timing exactly right, so you open the minimized document just before the browser embedded version of WORD paints itself, what you get is the two WORD documents are switched. The browser window displays the document that was in the minimized copy of WORD, and the stand alone version of WORD displays the document that should have been displayed in the browser instance.

The automation interface is still manipulating the correct document, even though the document is opened in the wrong container. For example, if you print the document using javascript in the browser, the document that gets printed is the one in the other window.

Have you ever come across this phenomenon?

I tried again, making absolutely sure that it was 7.5.0.331 installed, as you suggested. It is still happening. It is important that you follow the sequence precisely….if you open word before you open the OfficeViewer demo app then everything is OK. If you follow the following steps, it should occur:

1) Reboot your machine

2) Start the OfficeViewer HTML demo app by double clicking on officeviewer.htm in the samples folder. Enable the OCX by choosing: “allow blocked content”

3) Open an existing WORD document in the OfficeViewer App

4) Open a stand alone instance of word, and type a sentence in it.

5) Choose the “close doc” option on the OfficeViewer.htm menu. When the doc closes, instead of seeing an “empty” instance of WORD, you see the “blank” page. This is how you can tell it is going to happen. If you try the next test below, after hitting “Close doc” you will still see there is still an instance of word present with the toolbar, but no document..

6) Close the browser window (using the x). the stand alone instance of WORD will close, along with the browser window.

Clearly, in the above example, what has happened is the OfficeViewer has gotten mixed up, and is internally pointing to the stand alone instance of WORD, instead of the instance of word it was housing. So when the browser window closed, it shut down WORD as well.

If you try the following sequence, you will not see the stand alone instance of Office close:

Test 2:

1) Reboot your machine

2) Open a stand alone instance of word and minimize it to the task bar

3) Start the OfficeViewer HTML demo app by double clicking on officeviewer.htm in the samples folder. Enable the OCX by cohoosing: “allow blocked content”

4) Open an existing WORD document in the OffiveViewer App

5) Open a stand alone instance of word, and type a sentence in it.

6) Choose the “close doc” option on the OfficeViewer.htm menu. When the doc closes, unlike in the test above, you will still see WORD open with its toolbar, but no document.

7) Close the browser window (using the x). the browser window will close, but the stand alone instance of WORD will stay open

Clearly, having an instance of WORD open before you instantiate the OfficeViewer seems to keep the instance pointers correct. In fact, in some situations, “windowless” WINWORD.EXE processes are left running by OfficeViewer, and if one of those is running, then the problem will not occur. In fact, one of the possible work arounds I have considered is to actually start a copy of WINWORD.EXE if there is not one currently running…

Test 3:

After doing test 2, close both instances of WORD, and re-try test 1, without doing the reboot. Everything works correctly. As far as I can tell, once it works “correctly” it won’t happen again.

This is very reproducible on all of our corporate machines. Would it be possible for you to try again, following those instructions exactly? If you are absolutely sure it is not happening on your environments, then I will have to start looking at our machine configs….but I could literally spend weeks on it, and if it turns out that it in fact is happening on your machines as well, then it would be totally wasted time. So I would really appreciate it if you could try again, following that precise sequence above…it could same me hundreds of hours of effort!

How to add Word Component to your ASP.NET project

It’s very easy to embed the MS Word in your asp.net project.  Please follow the steps:
1. Open Visual Studio.
2. Create a new ASP.NET project.
3. Don not attempt to add the Edraw Viewer Component for Word to the
Toolbox. It is a client component. You can add it as the HTML Object.
4. Copy all files at the ASP_c#\ to the new project folder.
( UploadAction.aspx UploadAction.aspx.cs Default.aspx.cs Default.aspx
Tester.doc )
5. Then add exist items…
6. Modify the Server Port in the Default.aspx.
6. Run.