var ntko;//控件对象 //初始化去打开文档 function init(cmd,filePath,folderId,userName){ ntko = document.getElementById("TANGER_OCX"); ntko.activate(true); ntko.AddDocTypePlugin(".pdf","PDF.NtkoDocument","5.0.4.0","officecontrol/ntkooledocall.cab",51,true); ntko.WebUserName =userName ; ntko.Menubar = true; ntko.FileNew = false; ntko.FileOpen = false; ntko.FileClose = false; ntko.FileSaveAs = false; ntko.FilePrint = true; ntko.FilePrintPreview = true; ntko.Toolbars = true; //是否显示痕迹菜单 ntko.AddCustomButtonOnMenu(0," 显示痕迹",true,2); //迁入版本 if(folderId != 'historys'){ ntko.AddCustomButtonOnMenu(3," 迁入版本",true,4); } /* //迁入版本 if("" != 'historys'){ ntko.AddCustomButtonOnMenu(3," 迁入版本",true,4); } //模板菜单 ntko.AddCustomMenu2(2," 选择模板 "); ntko.AddCustomMenuItem2(2,0,-1,true,"要闻参考",1); ntko.AddCustomMenuItem2(2,1,-1,true,"信息参阅",2); ntko.AddCustomMenuItem2(2,2,-1,true,"天河舆情要闻",3); ntko.AddCustomMenuItem2(2,3,-1,true,"天府简报(专刊)",4); ntko.AddCustomMenuItem2(2,4,-1,true,"天府简报(专送)",5); ntko.AddCustomMenuItem2(2,5,-1,true,"天府简报(动态)",6);*/ if (cmd == 1) { ntko.OpenFromURL("ntkocreatnew.docx"); } else { if(cmd==5){ ntko.OpenFromURL("aboutus1.docx"); ntkoBrowser.ntkoSetReturnValueToParentPage("ntkoSendDataToChildtext","ntko"); }else{ ntko.OpenFromURL(filePath); } } } function OnCustomButtonOnMenuCmd(btnPos,btnCaption,btnCmdid){ ntko.ShowTipMessage("提示",btnCmdid); if(2 == btnCmdid) { TANGER_OCX_OBJ.ActiveDocument.ShowRevisions = true;//设置是否显示痕迹 TANGER_OCX_OBJ.AddCustomButtonOnMenu(0," 隐藏痕迹",true,3); TANGER_OCX_OBJ.ActiveDocument.TrackRevisions = true;//设置是否保留痕迹 } if(3 == btnCmdid) { TANGER_OCX_OBJ.ActiveDocument.ShowRevisions = false;//设置是否显示痕迹 TANGER_OCX_OBJ.AddCustomButtonOnMenu(0," 显示痕迹",true,2); TANGER_OCX_OBJ.ActiveDocument.TrackRevisions = false;//设置是否保留痕迹 } if(4 == btnCmdid) { //checkIn(); } }