Java?Web?Office?文档在线编辑

1、创建页面

Office在线编辑


function CreateDoc()
{
document.all.OA1.CreateNew( "Word.Document");
}
function CreateExcel()
{
document.all.OA1.CreateNew( "Excel.Sheet");
}
function CreatePPT()
{
document.all.OA1.CreateNew( "PowerPoint.Slide");
}
function OpenFromLocal()
{
document.all.OA1.OpenLocalDialog();
}
function ShowToolbars()
{
var x = document.all.OA1.GetToolbarsIsShow();
document.all.OA1.ShowToolbars( !x);
}
function PrintFile()
{
if(document.all.OA1.IsOpen())
{
document.all.OA1.Print();
}
}
function DocIsDirty()
{
if(document.all.OA1.IsOpen())
{
if(document.all.OA1.IsDirty())
{
window.alert("The file has been modified!");
}
else
{
window.alert("The file hasn't been modified!");
}
}
}
function SaveAs()
{
document.all.OA1.SaveLocalDialog();
}
function CloseFile()
{
if(document.all.OA1.IsOpen())
{
document.all.OA1.Close();
}
}
function OpenFromServer()
{
var sPath= mpt("服务器文件路径:", "16:6888/msbb/tmp/office/test.doc");
document.all.OA1.OpenWebFile(sPath)
}
function SavetoServer()
{
if(document.all.OA1.IsOpen())
{
window.alert("保存文件到服务器!");
document.all.OA1.SaveWebFile("16:6888/msbb/UpLoadServlet");
}
}
codebase="16:6888/msbb/tmp/office/OA.CAB#3,1,0,4">