《DSOFramer原有的接口说明》由会员分享,可在线阅读,更多相关《DSOFramer原有的接口说明(12页珍藏版)》请在金锄头文库上搜索。
1、返回当前活动文档的Dispatch接口,这个接口很重要,可以通过这个接口,操作所有的文档接口.如:下面 javascript 语句调用Office内置的对话框var obj;.声明:本文档由山东电建(sddianjian)上传到豆丁网(),若有侵害您的权益,请发站内消息。DSOFramer原有的接口说明=DSOFramer原有的接口说明1.void CreateNew(BSTR ProgIdOrTemplate)新建文档,其中: ProgIdOrTemplate参数:Excel Spreadsheet Excel.Sheet Excel Chart Excel.Chart PowerPoint
2、 PresentationPowerPoint.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) 打开文档,可以是本地文件或者是服务
3、器文件参数: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.HRES
4、ULT 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接口,这个接口很重要,可以通过这个接口
5、,操作所有的文档接口。如:下面 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;6.HRESULT Close();关闭当前文档,建议在页面关闭的时候调用。MS的原来的版本,有时候关不掉Word,已经修复了。7.HRESULT Caption(out,retval BSTR* pb
6、str);属性,获取|设置窗口标题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 S
7、howDialog(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* pst
8、yle);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
9、 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* vInOutPar
10、am);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); 文档的路径23.HRESULT PrintOut(in, optional VARIANT PromptUser, in, optional VARIANT PrinterN
11、ame, 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); 是否保存了,实际可以用来
12、判读文档有没有修改 oframer.IsDirty = TRUE /文档没有保存,处于修改状态 oframer.IsDirty = FALSE /文档已经保存,没有修改新加的接口说明(开发接口)color=redb当前版本:V2.2.0.8 2007-02-07/b/color下载控件需要登录说明:控件未经大批量测试,难免有Bug,发现 Bug,请及时发帖或者Mail:版本修改记录:V2.2.0.8修改: 增加了N多个事件,挺不错的东西 id(DSOF_DISPID_WORD_DocumentChange), helpstring(DSOF_DISPID_WORD_DocumentChange
13、) 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_WindowBeforeDo