最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

幾個javascript操作word的參考代碼

 更新時間:2009年10月26日 17:48:30   作者:  
幾個javascript操作word的參考代碼,對于具體的調(diào)用代碼,大家可以參考我們的上一篇文章。
復(fù)制代碼 代碼如下:

/*
給幾個js寫word的參考:
this.Word.Selection.Font.Size = 16; //字體大小
this.Word.Selection.Font.Bold = true; //是否加粗
this.Word.Selection.ParagraphFormat.Alignment = 2; //0左對齊,1居中,2右對齊,數(shù)字只能0-9,慢慢試吧
this.Word.Selection.InsertRowsBelow(1); //下面加入一行
this.Word.Selection.MoveRight(1); //光標(biāo)右移
this.Word.Selection.TypeText(string); //只能寫string
this.Word.Selection.MoveDown(); //光標(biāo)下移
this.Word.Selection.EndKey(); //光標(biāo)移動到末尾
this.Word.ActiveDocument.Sections(1).Headers(1).Range.InsertAfter(string); //寫頁眉,結(jié)尾處寫
this._LoadData = function () {
//替換函數(shù),用于替換$strFld$類型的文本
 function replace( Range, strFld ) {
//[FindText], [MatchCase], [MatchWholeWord], [MatchWildcards], [MatchSoundsLike], [MatchAllWordForms], [Forward], [Wrap], [Format], [ReplaceWith], [Replace], [MatchKashida], [MatchDiacritics], [MatchAlefHamza], [MatchControl]
 Range.Find.Execute( "$"+strFld+"$", true, false, false, false, false, true, wdFindContinue, false, getElValue("l"+strFld) )
 }
//初始化Word控件
 this._InitWord = function ()
 {
 try{
 this.Word = new ActiveXObject("Word.Application");
 this.Word.visible = true;
 this.Doc = this.Word.Documents.Open( this.TemplatePath );
 this.Doc.Activate();
 this.Range = this.Doc.Range();
 return true
 } catch(e) {
 //TODO: 如果用戶手動取消ActiveX的運(yùn)行,則會留一WINWORD.EXE的進(jìn)程。
 //除非"設(shè)為可信站點(diǎn),并在自定義級別里將第二項(xiàng)啟用",則不會出現(xiàn)啟用ActiveX的對話框。
 try {
 if ( this.Doc ) { this.Doc.Close(0) };
 if ( this.Word ) { this.Word.Quit() }
 }
 catch (e){}
 return false
 }
 }
*/

相關(guān)文章

最新評論

临沂市| 高要市| 濉溪县| 宜兰县| 建昌县| 靖安县| 筠连县| 盈江县| 台江县| 西吉县| 万州区| 和静县| 南康市| 长武县| 松桃| 阿尔山市| 永德县| 金门县| 迭部县| 淳安县| 张家港市| 阆中市| 鹤庆县| 伽师县| 子长县| 大理市| 泸水县| 崇仁县| 保靖县| 奎屯市| 寿宁县| 绥芬河市| 扎兰屯市| 雅安市| 称多县| 连云港市| 两当县| 罗源县| 东辽县| 吉首市| 柳河县|