点聚weboffice常用接口.docx
- 文档编号:2822713
- 上传时间:2022-11-15
- 格式:DOCX
- 页数:24
- 大小:19.01KB
点聚weboffice常用接口.docx
《点聚weboffice常用接口.docx》由会员分享,可在线阅读,更多相关《点聚weboffice常用接口.docx(24页珍藏版)》请在冰豆网上搜索。
点聚weboffice常用接口
点聚weboffice常用接口
本文引用自wangfeng_mails《点聚weboffice常用接口》
/****************************************************
*
* 关闭页面时调用此函数,关闭文件
*
****************************************************/
functionwindow_onunload(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.Close();
}catch(e){
// alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 新建文档
*
****************************************************/
functionnewDoc(){
try{
varwebObj=document.getElementById("WebOffice1");
vardoctype=document.getElementById("doctype").value;
webObj.LoadOriginalFile("",doctype);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 显示打印对话框
*
/***************************************************/
functionshowPrintDialog(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.PrintDoc
(1);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 直接打印
*
****************************************************/
functionzhiPrint(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.PrintDoc(0);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 关闭页面时调用此函数,关闭文件
*
****************************************************/
functionwindow_onunload(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.Close();
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 解除文档保护
*
****************************************************/
functionUnProtect(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.ProtectDoc(0,1,document.all.docPwd.value);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 设置文档保护
*
****************************************************/
functionProtectFull(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.ProtectDoc(1,1,document.all.docPwd.value);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 禁止打印
*
****************************************************/
functionnotPrint(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.SetSecurity(0x01);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 恢复允许打印
*
/****************************************************/
functionokPrint(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.SetSecurity(0x01+0x8000);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 禁止保存
*
****************************************************/
functionnotSave(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.SetSecurity(0x02);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 恢复允许保存
*
/****************************************************/
functionokSave(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.SetSecurity(0x02+0x8000);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 禁止复制
*
/****************************************************/
functionnotCopy(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.SetSecurity(0x04);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 恢复允许复制
*
/****************************************************/
functionokCopy(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.SetSecurity(0x04+0x8000);
}catch(e){
alert("异常\r\nError:
"+e+"\r\nErrorCode:
"+e.number+"\r\nErrorDes:
"+e.description);
}
}
/****************************************************
*
* 禁止拖动
*
/****************************************************/
functionnotDrag(){
try{
varwebObj=document.getElementById("WebOffice1");
webObj.SetSecurity(0x08);
}catch(e){
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- weboffice 常用 接口
![提示](https://static.bdocx.com/images/bang_tan.gif)