Edraw Office Viewer Component 5.4 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, 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.

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

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

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

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

Edraw PDF Viewer Component V3.2 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 Component                   Purchase 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. 

Add some text at the end of Word document

How to add some text at the end of document that is opened in Edraw office viewer, Kindly send me java script code so that i can enter signatures in my document. Please reply as soon as possible and send my java script Example.

Disable Popup Menu in MS Office

You can disable or delete the context menu item in MS Word or Excel by VBA programming.

Word:

OA1.CreateNew “Word.Document”
Set objWord = OA1.ActiveDocument
objWord.Application.CommandBars(”Text”).Controls(”Cu&t”).Enabled = False
objWord.Application.CommandBars(”Text”).Controls(”&Copy”).Enabled = False
objWord.Application.CommandBars(”Text”).Controls(”&Paste”).Enabled = False
‘delete item directly
‘objWord.Application.CommandBars(”Text”).Controls(1).Delete
‘objWord.Application.CommandBars(”Text”).Controls(2).Delete ….

Excel

OA1.Open “c:\text.xls”
Set objExcel = OA1.ActiveDocument
objExcel .Application.CommandBars(”Cell”).Controls(”Cu&t”).Enabled = False
objExcel .Application.CommandBars(”Cell”).Controls(”&Copy”).Enabled = False
objExcel .Application.CommandBars(”Cell”).Controls(”&Paste”).Enabled = False
‘delete item directly
‘objExcel .Application.CommandBars(”Cell”).Controls(1).Delete
‘objExcel .Application.CommandBars(”Cell”).Controls(2).Delete ….

How to verify whether the open document is modified

If you are developing the destop application with the office viewer component, you can use the “IsDirty” method to verify whether the open document is modified. When the open file has any modification, the IsDirty method return TRUE. After you save the document, the IsDirty return False again.

But if you are developing the web application, you need to add some extra codes. Because you are opening a file from remote server and the component can’t watch the file like destop application.

A good method is set another variable in your application. When you save the document, you set the variable true. Any time you can judge the dirty by the IsDirty method and your own variable.

BOOL GetIsDirty(){

if(OA.IsDirty()==Flase) return False;

else return m_bDirty;

}

event OnDocumentOpened()

 

 

{

 

 

m_bDirty = false;

 

 

}

function UploadFile()

{

……

m_bDirty = False;

}

 

Play slideshow in the same window

Edraw Office Viewer Component provides a solution for opening then playing the slideshow file in the same window. Of course you can play it with full screen mode too.

Simply call the “SlideShowOpenAndPlay” method, you can get the follow effect immediately.

PowerPoint Viewer ActiveX Control

You can show or hide the titlebar, screenbar, toolbar too.

You can call it via javascript or vbscript in your html page as follow.

document.OA1.SlideShowOpenAndPlay(”http://www.ocxt.com/demo/samples/sample.ppt“, false, false, false, false);

OR:

OA1.Open(”http://www…./sample.pps“, “PowerPoint.Slide”);

OA1.SlideShowPlay(false, false, true, false);

[id(99), helpstring("Opens then plays the PowerPoint slide show file in the same window or full screen.")]
HRESULT SlideShowOpenAndPlay([in] VARIANT Document, [in] VARIANT_BOOL bFullScreen, [in] VARIANT_BOOL bShowWebToolbar, [in] VARIANT_BOOL bLoopUntilStopped, [in] VARIANT_BOOL bShowScrollBar, [in, optional] VARIANT WebUsername, [in, optional] VARIANT WebPassword);

[id(100), helpstring("Plays the PowerPoint slide show file in the same window or full screen.")]
HRESULT SlideShowPlay([in] VARIANT_BOOL bFullScreen, [in] VARIANT_BOOL bShowWebToolbar, [in] VARIANT_BOOL bLoopUntilStopped, [in] VARIANT_BOOL bShowScrollBar);

How to disable the file command buttons

The Office Viewer Component provides the method “EnableFileCommand” to allow the developers to disable the File command in the MS office program.

If you are developing a web application, you can set the initial functions in the “NotifyCtrlReady” event.

function OA1_NotifyCtrlReady() {
document.OA1.EnableFileCommand(0) = false; //FileNew = 0
}
<SCRIPT LANGUAGE=javascript FOR=OA1 EVENT=NotifyCtrlReady>
<!–
OA1_NotifyCtrlReady();
//–>
</SCRIPT>

More File Command ENUMS:

typedef enum FileCommandType
{
FileNew = 0,
FileOpen,
FileClose,
FileSave,
FileSaveAs,
FilePrint,
FilePageSetup,
FileProperties,
FilePrintPreview
} FileCommandType;

Edraw Office Viewer Component 5.3.407 Released

5.3.407.1 version is a maintenance update.

1. Provided the silent print for the MS office document.

2. Added WordGetCurrentPageIndex and WordGetTotalPageCounts to return the current page number and page counts in Word document. 

3. The ExcelGetCellValue won’t returns null when the date is numeric;

4. Supported to open an Office 2007 file from the remote server with the “Open” method directly.

5.3.288.1

1. Fixed the buffer overflow to execute arbitrary code via a long first argument to the HttpDownloadFileToTempDir method and FTPDownloadFile.

2. Solved the failture when saving an Excel document to the server and having a cell activated.

3. Removed the default overwrite reminder from Microsoft Excel if you save an open Excel file at the same position multiple times.

4. Solved: Return to the first page if you click the Document Map in a protected Microsoft Word document

5. Solved: The excel process keeps back when call the “OfficeProtectDocument” method.

6. Some other small improvements.

Pass optional parameters when you call a function in Visual C++

When you call a method that has optional parameters from Visual C++, you cannot omit the optional parameters. You need to pass a special VARIANT instead.

Some methods have “optional” parameters. In Visual Basic, you can omit them when calling the method. However, when calling with Visual C++, you have to pass a special VARIANT whose .vt field has the value VT_ERROR and .scode field has the value DISP_E_PARAMNOTFOUND. That is:

VARIANT varOpt;
varOpt.vt = VT_ERROR;
varOpt.scode = DISP_E_PARAMNOTFOUND;
OfficeViewer1.OfficeProtectDocument(varOpt);

Hide the Office ActiveX Control in Runtime

If you would like to hide the EDraw Office Viewer ActiveX Control in runtime, you need call the “OfficeObjectVisable” method.

For example: axOfficeViewer1.OfficeObjectVisable = false;

The follow code will lead to an error in C#.

axOfficeViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
axOfficeViewer2.Visible = false;
axOfficeViewer3.Visible = false;