最新修改日志 2007-12-12 (提供源代码下载)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
当前版本:V2.2.1.2 2007-12-12
控件下载:【见附件】
源代码: 【见附件,密码: [url]www.dsoframer.com[/url]】
常见问题:
1.如何自动下载,
DSO是标准的ActiveX控件,而且被签名了。浏览器会自动识别,把以下LoadDso.js include进去就可以了。
=============LoadDso.js 内容================
var s = ""
s += "<OBJECT id=DSOFramer align='middle' style='LEFT: 0px; WIDTH: 100%; TOP: 0px; HEIGHT: 100%'"
s += "classid=clsid:00460182-9E5E-11D5-B7C8-B8269041DD57 codeBase=dsoframer.ocx#version=2,2,1,2' >"
s += "</OBJECT>"
document.write(s)
=============LoadDso.js文件结束================
2.如何直接上传到服务器上
DSO采用模拟标准的HTTP协议,把数据Post到接收页面。
至于接受页面是ASP,PHP,JSP,.NET。。。如何编写,请参照目前市场上已经存在产品的例子。
3.修订留痕
下面接口有。慢慢找吧。
说明:
控件未经大批量测试,难免有Bug,
发现 Bug,请及时发帖或者Mail:wanhhf@gmail.com
版本修改记录:
V2.2.1.2:
修改了Office2007下保存的问题
修改了Vistia 下保存的问题
增加了几个小接口
V2.2.0.8修改:
增加了N多个事件,挺不错的东西
[id(DSOF_DISPID_WORD_DocumentChange), helpstring("DSOF_DISPID_WORD_DocumentChange")]
HRESULT WORD_DocumentChange();
[id(DSOF_DISPID_WORD_DocumentBeforePrint), helpstring("DSOF_DISPID_WORD_DocumentBeforePrint")]
HRESULT WORD_DocumentBeforePrint();
[id(DSOF_DISPID_WORD_WindowActivate), helpstring("DSOF_DISPID_WORD_WindowActivate")]
HRESULT WORD_WindowActivate();
[id(DSOF_DISPID_WORD_WindowSelectionChange), helpstring("DSOF_DISPID_WORD_WindowSelectionChange")]
HRESULT WORD_WindowSelectionChange();
[id(DSOF_DISPID_WORD_WindowBeforeRightClick), helpstring("DSOF_DISPID_WORD_WindowBeforeRightClick")]
HRESULT WORD_WindowBeforeRightClick();
[id(DSOF_DISPID_WORD_WindowBeforeDoubleClick), helpstring("DSOF_DISPID_WORD_WindowBeforeDoubleClick")]
HRESULT WORD_WindowBeforeDoubleClick();
V2.2.0.6修改:
修改Open,参数为空时候,一个小 Bug
修改了URL过长时候一个Bug
增加了一个替换文字的接口
long ReplaceText(BSTR strSearchText, BSTR strReplaceText, long lGradation);
V2.2.0.2修改:
修改了HttpPost相对路径的一些问题。
V2.2.0.0增加:
[id(0x00010041), helpstring("Get Rev Index")]
HRESULT GetRevCount( [out,retval] long * pbool);
[id(0x00010042), helpstring("Get Rev Index Info")]
HRESULT GetRevInfo([in] long lIndex, [in] long lType, [out,retval] BSTR* pbool);
[id(0x00010043), helpstring("Set Doc Prop")]
HRESULT SetValue([in] BSTR strValue, [in] BSTR strName, [out,retval] long* pbool);
[id(0x00010044), helpstring("Set Doc Variable")]
HRESULT SetDocVariable([in] BSTR strVarName, [in] BSTR strValue,[in] long lOpt, [out,retval] long* pbool);
[id(0x00010045), helpstring("Save page To Doc")]
HRESULT SetPageAs([in] BSTR strLocalFile, [in] long lPageNum, [in] long lType,[out,retval] long* pbool);
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
==========================新增加接口=========================================
//新建Word
document.all.FramerControl1.CreateNew("Word.Document");
//新建Excel
document.all.FramerControl1.CreateNew("Excel.Sheet");
//打开制定的本地文件
document.all.FramerControl1.Open("C:\\TestBook.xls");
//制定用Word来打开c:\plain.txt文件
document.all.FramerControl1.Open("C:\\Plain.txt",false, "Word.Document");
//打开服务器的文件
document.all.FramerControl1.Open "https://secureserver/test/mytest.asp?id=123",true, "Excel.Sheet", "MyUserAccount", "MyPassword");
//打开服务器的文件
document.all.FramerControl1.Open("http://localhost/1.doc", true);
//到本地
document.all.FramerControl1.Save("c:\\1.doc",true);
//服务器
//初始化Http引擎
document.all.FramerControl1.HttpInit();
//增加Post变量
document.all.FramerControl1.HttpAddPostString("RecordID","20060102200");
document.all.FramerControl1.HttpAddPostString("UserID","李局长");
//上传打开的文件
document.all.FramerControl1.HttpAddPostCurrFile("FileData", "文档名.doc");
//执行上传动作
document.all.FramerControl1.HttpPost("http://xxxx.com/uploadfile.asp");
//进入留痕状态
document.all.FramerControl1.SetTrackRevisions(1);
//进入非留痕状态
document.all.FramerControl1.SetTrackRevisions(0);
//接受当前修订
document.all.FramerControl1.SetTrackRevisions(4);
document.all.FramerControl1.SetCurrUserName("张三");
document.all.FramerControl1.SetCurrTime("2006:02:07 11:11:11");
//在当前WORD位置插入标签,标签名为"book1",数值为"test"
document.all.FramerControl1.SetFieldValue("book1","test","::ADDMARK::");
//设置书签"Time",数值为"2006-03-16 22:22:22"
document.all.FramerControl1.SetFieldValue("Time","2006-03-16 22:22:22","");
//在书签位置"hongtou",插入红头文件"http://222.222.222.222/hongtou1.doc" 这样,红头就自动插进去了
document.all.FramerControl1.SetFieldValue("hongtou","http://222.222.222.222/hongtou1.doc","::FILE::");
//只有“新建”菜单可用
document.all.FramerControl1..SetMenuDisplay(1);
//只有“打开”菜单可用
document.all.FramerControl1.SetMenuDisplay(2);
//只有“打开”和“新建”菜单可用
document.all.FramerControl1.SetMenuDisplay(3);
//完全保护文档,密码为"pwd"
document.all.FramerControl1.ProtectDoc(1,1,"pwd");
//解除文档保护
document.all.FramerControl1.ProtectDoc(0,1,"pwd");
//显示修订留痕
document.all.FramerControl1.ShowRevisions(1);
//隐藏修订留痕
document.all.FramerControl1.ShowRevisions(0);
//文件头部插入文件
document.all.FramerControl1.InSertFile("http://XX.com/XX.doc",1);
//文件尾部插入文件
document.all.FramerControl1.InSertFile("http://XX.com/XX.doc",2);
//当前光标位置插入文件
document.all.FramerControl1.InSertFile("http://XX.com/XX.doc",0);
//文件头部插入图片
document.all.FramerControl1.InSertFile("http://XX.com/XX.jpg",9);
//文件尾部插入图片
document.all.FramerControl1.InSertFile("http://XX.com/XX.jpg",10);
//当前光标位置插入图片
document.all.FramerControl1.InSertFile("http://XX.com/XX.jpg",8);
//大纲模式
document.all.FramerControl1.ShowView(5);
var vCount;
vCount = document.all.FramerControl1.GetRevCount();
alert(vCount);
var vOpt = 0;
var vDate;
for(var i=1; i<= vCount; i++){
vOpt = document.all.FramerControl1.GetRevInfo(i,2);
if("1" == vOpt){
vOpt = "插入";
}else if("2" == vOpt){
vOpt = "删除";
}else{
vOpt = "未知操作";
}
vDate = new String(document.all.FramerControl1.GetRevInfo(i,1));
vDate = parseFloat(vDate);
alert(vDate);
dateObj = new Date(vDate);
alert(dateObj.getYear() + "年" + dateObj.getMonth() + 1 + "月" + dateObj.getDate() +"日" + dateObj.getHours() +"时" + dateObj.getMinutes() +"分" + dateObj.getSeconds() +"秒" );
alert("用户:"+document.all.FramerControl1.GetRevInfo(i,0) + "\r\n操作:" + vOpt + "\r\n内容:" + document.all.FramerControl1.GetRevInfo(i,3));
}
//设置文件只读密码
document.all.FramerControl1.SetValue("password","::DOCPROP:PassWord");
//设置文件修改密码
document.all.FramerControl1.SetValue("password","::DOCPROP:WritePW");
==========================新增加接口结束=========================================
========
评论0
最新资源