Author Posts

May 8, 2018 at 4:45 am

0

Hi All,
I've got the below PowerShell script for setting the default Outlook email signature: https://github.com/a118n/poweradmin/blob/master/Set-Outlook-Signature/Set-Outlook-Signature.ps1
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.

May 9, 2018 at 12:02 am

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