欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

幾個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)文章

最新評論