Set-Font
Command Description
Set the style of the currently selected text in the opened Word document
Command Prototype
Word.SetFontName(objWord,sName)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
objWord | True | expression | objWord | Word document object |
sName | True | string | "Arial" | Font name |
Demo
/************************************Set font************** ************************
Command prototype:
Word.SetFontName(objWord,sName)
Input parameters:
objWord--Word document object
sName--font name
*********************************************************************************/
Dim objWord
objWord = Word.Open('''C:\Users\Administrator\Desktop\Standardization Implementation Notes.docx''',"xw4131221","",true)\
Word.SelectRow(objWord,3,5)
Word.SetFontName(objWord,"Song font")