Posted by office viewer on June 3rd, 2009

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
You can find the sample projects and help document in the install folder. Learn More
Posted by office viewer on May 17th, 2009

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.

PDF Viewer Component Features
-
Seamlessly use the Adobe Reader as the container to render the PDF files. 100% PDF format compatible.
-
HTTP/HTTPS Support. With the component it is easy to upload or download file between distant server and client via HTTP/FTP.
-
Show/Hide the Save Copy As button which is available in adobe tool bar.
-
Show/Hide the PDF Print button in adobe tool bar.
-
Show/Hide the scrollbar in PDF viewer.
-
Disable the right-click menu in adobe reader window.
-
Disable all the hot keys such as Save As, Print, Show/Hide Tool Bar and more.
-
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.
-
A standard ActiveX control which can be called from different programming languages, including C/C++, C#, Delphi, Visual Basic, ASP.NET etc.
-
Requires any edition of Adobe PDF Reader is included as part of the comprehensive PDF Viewer Component.
Posted by office viewer on February 16th, 2009
The Edraw Office Viewer Component V5.6 fixed the bug which the component closes the Excel document (but leaves Excel running) if I have Excel open in another window. Fixed the bug which The Excel process in background is still running and not terminated actually.
Posted by office viewer on October 3rd, 2008
Use Edraw Office 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″
Posted by office viewer on September 5th, 2008
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.
Posted by office viewer on August 12th, 2008
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.
Posted by office viewer on August 7th, 2008
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 ….
Posted by office viewer on July 15th, 2008
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;
}
Posted by cathy on July 14th, 2008
After installed the latest demo version, you can open the excel from file stream using the following code:
objExcel.HttpInit();
objExcel.HttpAddPostFile(”",”Evaluation.xlsx”);
objExcel.HttpOpenFileFromStream(”Evaluation/EvaluationReceiver.aspx”);
Before you call function HttpOpenFileFromStream, you should do two things, one is to initialize http for clearing all parameters and cookies in http, another thing is to appoint the file or database record. And then use HttpOpenFileFromStream to send the request to the destinated webpage. Before HttpOpenFileFromStream send request, it will add a couple of parameters automatically.
m_OAHttp.AddPostArgument(L”EDA_GETSTREAMDATA”, L”EDA_YES”); This couple of parameters tell the destinated webpage OfficeViewer will received file as stream.
At the web side, webpage will decide to read which file or database reacord accordding to the post parameters. And you should add boundary flag ‘EDA_STREAMBOUNDARY’ to file data, following is the asp.net demo.
if (Request.Params["EDA_GETSTREAMDATA"] == “EDA_YES”)
{
String fullFileName = Server.MapPath(Request.Params["DocumentID"]);
Byte[] fs = File.ReadAllBytes(fullFileName);
Response.Write(”Get Stream Successfully!”);
Response.Write(”EDA_STREAMBOUNDARY”);
Response.BinaryWrite(fs);
Response.Write(”EDA_STREAMBOUNDARY”);
}
Recent Comments