WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Word

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Change Font in Word Document

 Keywords: change Font word .doc  

Sample code:

fname = "c:\temp\test.doc"
oWord = ObjectCreate( "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
oDocs = 0
oWord = 0
exit

Article ID:   W15266
File Created: 2013:08:21:10:08:46
Last Updated: 2013:08:21:10:08:46