몇 개의 javascript 작업 워드 의 참고 코드

1707 단어 자바 scriptword

/*
js word :
this.Word.Selection.Font.Size = 16; //
this.Word.Selection.Font.Bold = true; //
this.Word.Selection.ParagraphFormat.Alignment = 2; //0 ,1 ,2 , 0-9,
this.Word.Selection.InsertRowsBelow(1); //
this.Word.Selection.MoveRight(1); //
this.Word.Selection.TypeText(string); // string
this.Word.Selection.MoveDown(); //
this.Word.Selection.EndKey(); //
this.Word.ActiveDocument.Sections(1).Headers(1).Range.InsertAfter(string); // ,
this._LoadData = function () {
// , $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 , WINWORD.EXE 。
// " , ", ActiveX 。
try {
if ( this.Doc ) { this.Doc.Close(0) };
if ( this.Word ) { this.Word.Quit() }
}
catch (e){}
return false
}
}
*/

좋은 웹페이지 즐겨찾기