
Many people have a need to display Microsoft Word content in Html page, and at present the options for doing so are very limited. The Internet Explore can show the ms word in the whole page, but there are lots of bugs for multiple MS instances in the users' computer, and certainly no support for embedding Word. This edraw office viewer component allows the developers to embed Word anywhere in a html application by simply insert the html object.
Download Office Viewer Component and View Sample Projects

Office Viewer Component Online Demo
This is how you use the office viewer component to host ms word document.
<object classid="clsid:7677E74E-5831-4C9E-A2DD-9B1EF9DF2DB4"
id="OA1" width="100%" height="100%" codebase="http://www.edrawsoft.com/download/officeviewer.cab#7,5,0,355">
<param name="Toolbars" value="-1">
<param name="BorderColor" value="15647136">
<param name="BorderStyle" value="2">
</object>
And this is how you display a word document on the fly.
function OpenFromServer()
{
var sPath= window.prompt("Type the file url:", "http://www.ocxt.com/demo/samples/sample.doc");
document.all.OA1.Open(sPath, "Word.Application");
}
The Word Component allows the developer to do the office automation.
function VBAProgramming()
{
if(document.OA1.IsOpened)
{
if(document.all.OA1.GetCurrentProgID() == "Word.Application"){
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 = "Automation 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 = "Automation 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 = "Automation 3";
}
}
}
It's possible to use the above code in ASP, ASP.NET or PHP language too. The component supports seamless integration with Word 97, Word 2000, Word 2003, Word 2007 and Word 2010.
Embed MS Office in ASP.NET Program
An Easy Way to Embed Excel in a Web Page
Disables MS Word Standard Command
Free Download Office Viewer Component and View Sample Projects
|
|
|
|||||||||
|
|
|