




已閱讀5頁,還剩7頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
返回當(dāng)前活動文檔的Dispatch接口,這個接口很重要,可以通過這個接口,操作所有的文檔接口.如:下面 javascript 語句調(diào)用Office內(nèi)置的對話框var obj;.聲明:本文檔由山東電建(sddianjian)上傳到豆丁網(wǎng)(),若有侵害您的權(quán)益,請發(fā)站內(nèi)消息。DSOFramer原有的接口說明=DSOFramer原有的接口說明1.void CreateNew(BSTR ProgIdOrTemplate)新建文檔,其中: ProgIdOrTemplate參數(shù):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)打開文檔,可以是本地文件或者是服務(wù)器文件參數(shù):Document 文檔路徑ReadOnly 是否已只讀模式打開ProgId OLE類型WebUsername 用戶名(訪問網(wǎng)絡(luò)的文件時(shí)候,有可能需要)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激活當(dāng)前文檔,沒搞明白有什么用5. HRESULT ActiveDocument(out,retval IDispatch* ppdisp);返回當(dāng)前活動文檔的Dispatch接口,這個接口很重要,可以通過這個接口,操作所有的文檔接口。如:下面 javascript 語句調(diào)用Office內(nèi)置的對話框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();關(guān)閉當(dāng)前文檔,建議在頁面關(guān)閉的時(shí)候調(diào)用。MS的原來的版本,有時(shí)候關(guān)不掉Word,已經(jīng)修復(fù) 。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 /文檔已經(jīng)保存,沒有修 新 的接口說明(開發(fā)接口)color=redb當(dāng)前版本:V 2007-02-07/b/color下 件需要 說明:件 經(jīng) ,有Bug,發(fā) Bug,請時(shí)發(fā)currency1或者M(jìn)ail:版本修 :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,參數(shù) 時(shí)候,個 Bug修 URL過時(shí)候個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);/打開服務(wù)器的文件 document.all.FramerControl1.Open https:/secureserver/test/mytest.asp?id=123,true, Excel.Sheet, MyUserAccount, MyPassword);/打開服務(wù)器的文件 document.all.FramerControl1.Open(http:/localhost/1.doc, true);/*3.保存文件*/到本地document.all.FramerControl1.Save(c:1.doc,true);/服務(wù)器 /*“ Http議Post上傳接口,可以Post個動 頁面(jsp,asp,php.),由動 頁面 數(shù) 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);/接 當(dāng)前修document.all.FramerControl1.SetTrackRevisions(4);/*5. 置當(dāng)前用戶*/document.all.FramerControl1.SetCurrUserName( ); /*6. 置當(dāng)前時(shí) ( (Like 2006:02:07 11:11:11)*/document.all.FramerControl1.SetCurrTime(2006:02:07 11:11:11);/*7. 置 建 , 能 , 置 數(shù) 文件 SetFieldValue(BSTR strFieldName, BSTR strValue, BSTR strCmdOrSheetName)strFieldName: 名strValue:要 置的strCmdOrSheetName: :ADDMARK: BookMark:DELMARK: 這個BookMark:GETMARK: ” 到這個BookMark:FILE: 的是文件:JPG: 的是 來說:WORD中 是 的,可以通過 接口 數(shù) 置 中 。*/在當(dāng)前WORD 置 , 名 book1,數(shù) testdocument.all.FramerControl1.SetFieldValue(book1,test,:ADDMARK:);/ 置 Time,數(shù) 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 以下數(shù)的 #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.保護(hù)文檔 保護(hù)文檔lProOrUn:1:保護(hù)文檔;0: 保護(hù)lProType: wdNoProtection = -1,wdAllowOnlyRevisions = 0,wdAllowOnlyComments = 1,wdAllowOnlyFormFields = 2strProPWD:密碼*/完全保護(hù)文檔,密碼 pwd document.all.FramerControl1.ProtectDoc(1,1,pwd);/ 文檔保護(hù) document.all.FramerControl1.ProtectDoc(0,1,pwd);/*10. 或 修內(nèi)容ShowRevisions(long nNewValue)nNewValue = 0 則 修= 1 則 修*/ 修 document.all.FramerControl1.ShowRevisions(1);/ 修 document.all.FramerControl1.ShowRevisions(0);/*11. 并文件,strFieldPath 文件路徑,可以是http,ftp的路徑pPos = 0 /當(dāng)前鼠 置1;文件開 2;文件末尾pPos的第4 1的時(shí)候,代表 的是 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);/當(dāng)前光 置 文件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);/當(dāng)前光 置 document.all.FramerControl1.InSertFile(http:/XX.com/XX.jpg,8);/*0x31. 文檔另存 HRESULT SaveAs(in VARIANT strFileName, in VARIANT dwFileFormat, out,retval long* pbool); 參數(shù):strFileName:文件本地路徑,如c:11.docdwFileFormat: 文件格式dwFileFormat的數(shù) :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); 參數(shù):strFileName:文件本地路徑,如c:11.doc */ /*0x33. 建臨時(shí)文件HRESULT GetTempFilePath(out,retval BSTR* strValue); 返回:臨時(shí)文件的路徑地址。使用完后,用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:下 遠(yuǎn)程文件HRESULT DownloadFile( in BSTR strRemoteFile, in BSTR strLocalFile, out,retval BSTR* strValue); 參數(shù):strRemoteFile:遠(yuǎn)程路徑地址,http or FtpstrLocalFile: 本地保存地址,if strLocalFile = NULL then Create Temp File and return TempFiles Path*/*0x40:“ Http上傳時(shí)候的,附 其 文件9 HRESULT HttpAddPostFile(in BSTR strFileID, in BSTR strFileName, out,retval long* pbool);參數(shù):strFileID:文件的ID,供服務(wù)器端頁面 strFileName: 本地文件地址 */*0x41,0x42. 詳細(xì)的修信息。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() +時(shí) + dateObj.getMinutes() +分 + dateObj.getSeconds() +秒 );alert(用戶:+document.all.FramerControl1.GetRevInfo(i,0) + rn操作: + vOpt + rn內(nèi)容: + 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:不支持 ,請確”您的第二個參數(shù)沒有傳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域關(guān)聯(lián)的第二 1: 表 如果沒有這個則 第 1: 來支持return:0:OK-127:異常*/*0x45: 分頁保存HRESULT SetPageAs(in BSTR strLocalFile, in long lPageNum, in long lType,out,retval long* pbool);strLocalFile:本地路徑lPageNum:頁數(shù)*/DSO上傳服務(wù)器原理-Dsoframer1 件采用文件Http上傳接口 文
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 顱內(nèi)壓力監(jiān)測芯片行業(yè)技術(shù)發(fā)展策略研究
- 紡織企業(yè)生產(chǎn)設(shè)備安全操作規(guī)程
- 綠色環(huán)保貓砂行業(yè)深度解析
- 2025至2030中國自行車部件行業(yè)發(fā)展趨勢分析與未來投資戰(zhàn)略咨詢研究報(bào)告
- 文化遺產(chǎn)保護(hù)工程質(zhì)量保證措施
- 健康養(yǎng)生:中草藥產(chǎn)品開發(fā)策略
- 2025至2030中國膳食纖維糖果行業(yè)市場發(fā)展分析及商業(yè)模式與投融資報(bào)告
- 2025至2030中國腦膜炎奈瑟菌感染藥物行業(yè)產(chǎn)業(yè)運(yùn)行態(tài)勢及投資規(guī)劃深度研究報(bào)告
- 2025至2030中國能源和公用事業(yè)分析行業(yè)產(chǎn)業(yè)運(yùn)行態(tài)勢及投資規(guī)劃深度研究報(bào)告
- 2025至2030中國胃癌藥物行業(yè)發(fā)展趨勢分析與未來投資戰(zhàn)略咨詢研究報(bào)告
- 婚前協(xié)議(保護(hù)女方利益)
- 奉賢區(qū)教育系統(tǒng)師德師風(fēng)建設(shè)學(xué)習(xí)測試附有答案
- 西方經(jīng)濟(jì)學(xué)(第二版)完整整套課件(馬工程)
- 扶貧農(nóng)產(chǎn)品購銷合同協(xié)議(農(nóng)產(chǎn)品購銷合同模板)
- 汽車維修高級工考試試題及參考答案
- 檢驗(yàn)科安全管理制度匯總
- GB/T 5782-2016六角頭螺栓
- GB/T 23445-2009聚合物水泥防水涂料
- GB/T 13451.2-1992著色顏料相對著色力和白色顏料相對散射力的測定光度計(jì)法
- GB/T 11264-2012熱軋輕軌
- 山東省中小學(xué)校檔案管理暫行辦法
評論
0/150
提交評論