Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Change Font in Word Document

 Keywords: change Font word .doc  

Sample code:

fname = "c:\temp\test.doc"
oWord = ObjectOpen( "Word.Application")
oWord.Visible = @TRUE  ;Change to @FALSE to hide

oDocs = oWord.Documents
oDocs.open(fname)
oDoc = oWord.ActiveDocument

oRange = oDoc.Range()

oFont = oRange.Font
oFont.Name = "Times New Roman"
oFont.Size = 12

oDoc.Save
oDoc.Close
oWord.Quit
ObjectClose(oDocs)
ObjectClose(oWord)
exit

Article ID:   W15266