永中office的相关操作
function dd(){//插入图片
ntkoobj = document.getElementById("TANGER_OCX");
var re = ntkoobj.ActiveDocument.getCursorLocation();
var shape = ntkoobj.ActiveDocument.getShapes().addPictureWithPosition("D:\qq2.gif", re.getX()-85, re.getY()-85, re.getX()+85, re.getY()+85);
//第一个参数必须写本地图片的绝对路径,后面参数为定位属性。
shape.setLayoutIndex(4);
}
function ee(){//隐藏痕迹
ntkoobj = document.getElementById("TANGER_OCX");
ntkoobj.ActiveDocument.getRevisions().setViewType(1);
}
function ff(){//显示痕迹
ntkoobj = document.getElementById("TANGER_OCX");
ntkoobj.ActiveDocument.getRevisions().setViewType(0);
}
function cc(){//进入保护模式
ntkoobj = document.getElementById("TANGER_OCX");
ntkoobj.ActiveDocument.Protect(0,"123");//0代表修订,1代表批注,2代表填写窗体,3代表只读
}
function aa(){//退出保护模式
ntkoobj = document.getElementById("TANGER_OCX");
ntkoobj.ActiveDocument.unprotect("123");
}
|