Skip to main content

Set-Text-Size

Command Description

Set the font size of the currently selected text in the opened Word document

Command Prototype

Word.SetFontSize(objWord,iSize)

Parameter Description

ParameterRequiredTypeDefaultDescription
objWordTrueexpressionobjWordWord document object
iSizeTruenumber9Font size, numbers only

Demo

/************************************Set font size************* **************************** 
Command prototype:
Word.SetFontSize (objWord, Size)
Input parameters:
objWord--Word document object
iSize--the font size of the font, only numbers can be entered
Outgoing reference:
sRet -- The result returned after the command is run
*********************************************************************************/
Dim objWord
objWord = Word.Open('''C:\Users\Administrator\Desktop\Standardization Implementation Notes.docx''',"xw4131221","",true)
Word.SelectRow(objWord,3,5)
Word.SetFontSize(objWord,15)