How to change the MS Word font type and size using PowerShell ?


Hi All,
I’ve got the below PowerShell script for setting the default Outlook email signature:
Now I wonder what’s the command to set the font to be “Courier New” rather than the default Calibri font?

I have already got the MS Word document template created by the designer in the shared folder and saved with all font as Courier New, but still failed to change the font type from the default Calibri as per Normal.Dot file.

$MSWord = New-Object -com word.application $MSWord.Documents.Open("$LocalSignaturePath\$SignatureName.docx") $MSWord.Documents.Selection.Font.Name = 'Courier New'

And I have tried the below combination as well:

$MSWord.ActiveDocument.FontName = 'Courier New' $MSWord.ActiveDocument.Range.Font.Name = 'Courier New' $MSWord.ActiveDocument.Selection.Font.Name = 'Courier New' $MSWord.ActiveDocument.Text.Selection.Font= 'Courier New' $MSWord.ActiveDocument.Text.Selection.Font.Name = 'Courier New' $MSWord.ActiveDocument.Selection.Range.Font.Name = 'Courier New' $MSWord.ActiveDocument.Selection.Text.Font.Name = 'Courier New'

But it does not recognize the “Name” as the property.

Any help would be greatly appreciated.

Hi Olaf, that did not work.
Hence it is posted here.