




已阅读5页,还剩7页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
返回当前活动文档的Dispatch接口,这个接口很重要,可以通过这个接口,操作所有的文档接口.如:下面 javascript 语句调用Office内置的对话框var obj;.声明:本文档由山东电建(sddianjian)上传到豆丁网(),若有侵害您的权益,请发站内消息。DSOFramer原有的接口说明=DSOFramer原有的接口说明1.void CreateNew(BSTR ProgIdOrTemplate)新建文档,其中: ProgIdOrTemplate参数:Excel Spreadsheet Excel.Sheet Excel Chart Excel.Chart PowerPoint Presentation PowerPoint.Show Project Project MSProject.Project Visio Drawing Visio.Drawing Word Document Word.Document 2. HRESULT Open(in VARIANT Document, in, optional VARIANT ReadOnly, in, optional VARIANT ProgId, in, optional VARIANT WebUsername, in, optional VARIANT WebPassword)打开文档,可以是本地文件或者是服务器文件参数:Document 文档路径ReadOnly 是否已只读模式打开ProgId OLE类型WebUsername 用户名(访问网络的文件时候,有可能需要)WebPassword 密码例子:DsoFramer1.Open C:TestBook.xlsDsoFramer1.Open C:Plain.txt, , Word.Document /用Word来打开c:plain.txt文件DsoFramer1.Open https:/secureserver/test/mytest.asp?id=123, True, Excel.Sheet, MyUserAccount, MyPassword3.HRESULT Save(in, optional VARIANT SaveAsDocument, in, optional VARIANT OverwriteExisting, in, optional VARIANT WebUsername, in, optional VARIANT WebPassword);保存文件在本地DsoFramer1.Save c:1.doc4.Activate激活当前文档,没搞明白有什么用5. HRESULT ActiveDocument(out,retval IDispatch* ppdisp);返回当前活动文档的Dispatch接口,这个接口很重要,可以通过这个接口,操作所有的文档接口。如:下面 javascript 语句调用Office内置的对话框var obj;obj = new Object(document.all.FramerControl1.ActiveDocument);if(obj !=null)var dd;dd = obj.Application.Dialogs(84).Show();/. . /delete itdelete obj;16. HRESULT Close();关闭当前文档,建议在页面关闭的时候调用。MS的原来的版本,有时候关不掉Word,已经修复 。7. HRESULT Caption(out,retval BSTR* pbstr);, | 置 口 8. HRESULT Titlebar(in boolean vbool);HRESULT Titlebar(out,retval boolean* pbool);或者 9. HRESULT Toolbars(in boolean vbool);HRESULT Toolbars(out,retval boolean* pbool);或者 10. HRESULT ModalState(in boolean vbool);HRESULT ModalState(out,retval boolean* pbool);11.HRESULT ShowDialog(in dsoShowDialogType DlgType);对话框12.HRESULT EnableFileCommand(in dsoFileCommandType Item, in boolean vbool);HRESULT EnableFileCommand(in dsoFileCommandType Item, out,retval boolean* pbool);13. HRESULT BorderStyle(in dsoBorderStyle style);HRESULT BorderStyle(out, retval dsoBorderStyle* pstyle);14. HRESULT BorderColor(in OLE_COLOR clr);HRESULT BorderColor(out,retval OLE_COLOR* pclr);15. HRESULT BackColor(in OLE_COLOR clr);HRESULT BackColor(out,retval OLE_COLOR* pclr);16.HRESULT ForeColor(inOLE_COLOR clr);HRESULT ForeColor(out,retvalOLE_COLOR* pclr);17.HRESULT TitlebarColor(in OLE_COLOR clr);HRESULT TitlebarColor(out,retval OLE_COLOR* pclr);18.HRESULT TitlebarTextColor(in OLE_COLOR clr);HRESULT TitlebarTextColor(out,retval OLE_COLOR* pclr);19.HRESULT ExecOleCommand(in LONG OLECMDID, in, optional VARIANT Options, in, optional VARIANT* vInParam, in, out, optional VARIANT* vInOutParam);20.HRESULT Menubar(in boolean vbool);HRESULT Menubar(out,retval boolean* pbool);21.HRESULT HostName(in BSTR bstr);HRESULT HostName(out,retval BSTR* pbstr);22. HRESULT DocumentFullName(out,retval BSTR* pbstr);文档的路径223.HRESULT PrintOut(in, optional VARIANT PromptUser, in, optional VARIANT PrinterName, in, optional VARIANT Copies,in, optional VARIANT FromPage, in, optional VARIANT ToPage, in, optional VARIANT OutputFile);24.HRESULT PrintPreview();25.HRESULT PrintPreviewExit();26.HRESULT IsReadOnly(out,retval boolean* pbool);是否 只读的。27.HRESULT IsDirty(out,retval boolean* pbool);是否保存 , 可以用来 读文档有没有修 oframer.IsDirty = TRUE /文档没有保存, 修 oframer.IsDirty = FALSE /文档已经保存,没有修 新 的接口说明(开发接口)color=redb当前版本:V 2007-02-07/b/color下 件需要 说明:件 经 ,有Bug,发 Bug,请时发currency1或者Mail:版本修 :V修 :“ N个件,不fi的东flid(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();V修 : 修 Open,参数 时候,个 Bug修 URL过时候个Bug“ 个 文的接口long ReplaceText(BSTR strSearchText, BSTR strReplaceText, long lGradation);V修 :修 HttpPost对路径的问 。 V“ :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);3 id(0x00010045), helpstring(Save page To Doc)HRESULT SetPageAs(in BSTR strLocalFile, in long lPageNum, in long lType,out,retval long* pbool);-LoadDso.jsvar s = s += s += document.write(s) -接口文档:/*1.新建*/新建Worddocument.all.FramerControl1.CreateNew(Word.Document);/新建Exceldocument.all.FramerControl1.CreateNew(Excel.Sheet);/*2.打开文件*/打开”的本地文件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);/*3.保存文件*/到本地document.all.FramerControl1.Save(c:1.doc,true);/服务器 /*“ Http议Post上传接口,可以Post个动 页面(jsp,asp,php.),由动 页面 数 bool HttpInit();bool HttpAddPostString(BSTR strName, BSTR strValue);bool HttpAddPostCurrFile(BSTR strFileID, BSTR strFileName);BSTR HttpPost(BSTR bstr); */Httpdocument.all.FramerControl1.HttpInit();/“ Postdocument.all.FramerControl1.HttpAddPostString(RecordID,20060102200);document.all.FramerControl1.HttpAddPostString(UserID,);4/上传打开的文件document.all.FramerControl1.HttpAddPostCurrFile(FileData, 文档名.doc);/ 上传动作document.all.FramerControl1.HttpPost(/uploadfile.asp); /*4.修 */ document.all.FramerControl1.SetTrackRevisions(1);/ document.all.FramerControl1.SetTrackRevisions(0);/接 当前修document.all.FramerControl1.SetTrackRevisions(4);/*5. 置当前用户*/document.all.FramerControl1.SetCurrUserName( ); /*6. 置当前时 ( (Like 2006:02:07 11:11:11)*/document.all.FramerControl1.SetCurrTime(2006:02:07 11:11:11);/*7. 置 建 , 能 , 置 数 文件 SetFieldValue(BSTR strFieldName, BSTR strValue, BSTR strCmdOrSheetName)strFieldName: 名strValue:要 置的strCmdOrSheetName: :ADDMARK: BookMark:DELMARK: 这个BookMark:GETMARK: ” 到这个BookMark:FILE: 的是文件:JPG: 的是 来说:WORD中 是 的,可以通过 接口 数 置 中 。*/在当前WORD 置 , 名 book1,数 testdocument.all.FramerControl1.SetFieldValue(book1,test,:ADDMARK:);/ 置 Time,数 2006-03-16 22:22:22document.all.FramerControl1.SetFieldValue(Time,2006-03-16 22:22:22,);/在 置hongtou, 文件22/hongtou1.doc 这, 动 document.all.FramerControl1.SetFieldValue(hongtou,22/hongtou1.doc,:FILE:);/*8. 置 BOOL SetMenuDisplay(long lMenuFlag)lMenuFlag 以下数的 #define MNU_NEW 0x01#define MNU_OPEN 0x02#define MNU_CLOSE 0x045#define MNU_SAVE 0x08#define MNU_SAVEAS 0x16#define MNU_PGSETUP 0x64#define MNU_PRINT 0x256#define MNU_PROPS 0x32#define MNU_PRINTPV 0x126*/只有“新建”可用 document.all.FramerControl1.SetMenuDisplay(1);/只有“打开”可用 document.all.FramerControl1.SetMenuDisplay(2);/只有“打开” “新建”可用 document.all.FramerControl1.SetMenuDisplay(3);/*9.保护文档 保护文档lProOrUn:1:保护文档;0: 保护lProType: wdNoProtection = -1,wdAllowOnlyRevisions = 0,wdAllowOnlyComments = 1,wdAllowOnlyFormFields = 2strProPWD:密码*/完全保护文档,密码 pwd document.all.FramerControl1.ProtectDoc(1,1,pwd);/ 文档保护 document.all.FramerControl1.ProtectDoc(0,1,pwd);/*10. 或 修内容ShowRevisions(long nNewValue)nNewValue = 0 则 修= 1 则 修*/ 修 document.all.FramerControl1.ShowRevisions(1);/ 修 document.all.FramerControl1.ShowRevisions(0);/*11. 并文件,strFieldPath 文件路径,可以是http,ftp的路径pPos = 0 /当前鼠 置1;文件开 2;文件末尾pPos的第4 1的时候,代表 的是 InSertFile(BSTR strFieldPath, long lPos)*/文件 部 文件document.all.FramerControl1.InSertFile(http:/XX.com/XX.doc,1);6/文件尾部 文件 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);/*0x31. 文档另存 HRESULT SaveAs(in VARIANT strFileName, in VARIANT dwFileFormat, out,retval long* pbool); 参数:strFileName:文件本地路径,如c:11.docdwFileFormat: 文件格式dwFileFormat的数 :Excel: Typeenum XlFileFormatxlAddIn = 18,xlCSV = 6,xlCSVMac = 22,xlCSVMSDOS = 24,xlCSVWindows = 23,xlDBF2 = 7,xlDBF3 = 8,xlDBF4 = 11,xlDIF = 9,xlExcel2 = 16,xlExcel2FarEast = 27,xlExcel3 = 29,xlExcel4 = 33,xlExcel5 = 39,xlExcel7 = 39,xlExcel9795 = 43,xlExcel4Workbook = 35,xlIntlAddIn = 26,xlIntlMacro = 25,xlWorkbookNormal = -4143,xlSYLK = 2,xlTemplate = 17,xlCurrentPlatformText = -4158,xlTextMac = 19,xlTextMSDOS = 21,xlTextPrinter = 36,xlTextWindows = 20,xlWJ2WD1 = 14,7 xlWK1 = 5,xlWK1ALL = 31,xlWK1FMT = 30,xlWK3 = 15,xlWK4 = 38,xlWK3FM3 = 32,xlWKS = 4,xlWorks2FarEast = 28,xlWQ1 = 34,xlWJ3 = 40,xlWJ3FJ3 = 41,xlUnicodeText = 42,xlHtml = 44;Word: Typeenum WdSaveFormatwdFormatDocument = 0,wdFormatTemplate = 1,wdFormatText = 2,wdFormatTextLineBreaks = 3,wdFormatDOSText = 4,wdFormatDOSTextLineBreaks = 5,wdFormatRTF = 6,wdFormatUnicodeText = 7,wdFormatEncodedText = 7,wdFormatHTML = 8;PPT:enum PpSaveAsFileTypeppSaveAsPresentation = 1,ppSaveAsPowerPoint7 = 2,ppSaveAsPowerPoint4 = 3,ppSaveAsPowerPoint3 = 4,ppSaveAsTemplate = 5,ppSaveAsRTF = 6,ppSaveAsShow = 7,ppSaveAsAddIn = 8,ppSaveAsPowerPoint4FarEast = 10,ppSaveAsDefault = 11,ppSaveAsHTML = 12,ppSaveAsHTMLv3 = 13,ppSaveAsHTMLDual = 14,ppSaveAsMetaFile = 15,ppSaveAsGIF = 16,ppSaveAsJPG = 17,ppSaveAsPNG = 18,8 ppSaveAsBMP = 19;*/*0x32. 本地文件HRESULT DeleteLocalFile(in BSTR strFilePath); 参数:strFileName:文件本地路径,如c:11.doc */ /*0x33. 建临时文件HRESULT GetTempFilePath(out,retval BSTR* strValue); 返回:临时文件的路径地址。使用完后,用DeleteLocalFile */*0x34. 置文档 模式HRESULT ShowView(in long dwViewType, out,retval long * pbool); dwViewType的可 :enum WdViewTypewdNormalView = 1,wdOutlineView = 2,wdPrintView = 3,wdPrintPreview = 4,wdMasterView = 5, /这个是 纲wdWebView = 6;*/ / 纲模式document.all.FramerControl1.ShowView(5);/*0x39:下 远程文件HRESULT DownloadFile( in BSTR strRemoteFile, in BSTR strLocalFile, out,retval BSTR* strValue); 参数:strRemoteFile:远程路径地址,http or FtpstrLocalFile: 本地保存地址,if strLocalFile = NULL then Create Temp File and return TempFiles Path*/*0x40:“ Http上传时候的,附 其 文件9 HRESULT HttpAddPostFile(in BSTR strFileID, in BSTR strFileName, out,retval long* pbool);参数:strFileID:文件的ID,供服务器端页面 strFileName: 本地文件地址 */*0x41,0x42. 详细的修信息。GetRevCount( out,retval long * pbool);GetRevInfo(in long lIndex, in long lType, out,retval BSTR* pbool);例子如下*/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 = ;elsevOpt = 知操作;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) + rn操作: + vOpt + rn内容: + document.all.FramerControl1.GetRevInfo(i,3);/*0x43. 置基本信息:HRESULT SetValue(in BSTR strValue, in BSTR strName, out,retval long* pbool);1. 置文件只读密码SetValue(password,:DOCPROP:PassWord);2. 置文件修 密码SetValue(password,:DOCPROP:WritePW);返回:0 正确-1:不支持 ,请确”您的第二个参数没有传fi-127:异常*/10/ 置文件只读密码document.all.FramerControl1.SetValue(password,:DOCPROP:PassWord);/ 置文件修 密码document.all.FramerControl1.SetValue(password,:DOCPROP:WritePW);/*0x44. 置文档,这个很少能用到HRESULT SetDocVariable(in BSTR strVarName, in BSTR strValue,in long lOpt, out,retval long* pbool);strVarName: 名strVlaue:lOpt: 操作类型,按 第 1: 表 update域关联的第二 1: 表 如果没有这个则 第 1: 来支持return:0:OK-127:异常*/*0x45: 分页保存HRESULT SetPageAs(in BSTR strLocalFile, in long lPageNum, in long lType,out,retval long* pbool);strLocalFile:本地路径lPageNum:页数*/DSO上传服务器原理-Dsoframer1 件采用文件Http上传接口 文
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 草种育种研发合作协议
- 护理管道标识管理
- 护理质控数据解读
- 勾股定理与实际应用的八大重难点题型(原卷版)-2024-2025学年八年级数学下册
- 高考数学总复习:二项分布、超几何分布与正态分布
- 动物的运动、行为和动物在生物圈中的作用(综合测试)-2025年中考生物一轮复习(含解析)
- 专题01 浓浓亲情读后续写-2025年高考英语话题写作高频热点通关攻略(原卷版)
- 急性心肌梗死护理流程
- 推拿治疗的作用
- 猝死护理不良事件管理要点
- 专题17 语言要简明+考场满分作文攻略-【同步作文课】【知识精研】七年级语文下册单元写作深度指导(统编版2024)
- 保洁合同协议书模板下载
- 2025法语DELFA15级阅读理解试卷及答案
- 交通设计(Traffic Design)知到智慧树章节测试课后答案2024年秋同济大学
- 2025年日历表(A4版含农历可编辑)
- MOOC 数值天气预报-南京信息工程大学 中国大学慕课答案
- MOOC 大学物理-力学、电磁学-重庆大学 中国大学慕课答案
- 《事业单位人事管理条例》及其配套制度讲义课件
- 试卷交接签字单
- 传媒公司合作合同
- 测量-极坐标法讲义
评论
0/150
提交评论