I need some help in modifying the below Set-Outlook-Signature.ps1 that is from https://github.com/a118n/poweradmin/blo ... nature.ps1
So I can adjust the email font template to below:
Font Type: Consolas
Font Size: 12
Font Colour: Blue
I manually created the .DOCX and then manually set the font typeface to be Consolas.
However the end result is that Outlook always using the font as Calibri (Office default).
FYI this is the location of my .DOCX template: \\domain.com\SYSVOL\EmailSignature\Outlook Signature.docx
and the content is like below:
Code: Select all
AD_DisplayName
AD_Title AD_Company
AD_Email
Mobile: AD_MobilePhone | Phone: AD_Telephone
AD_Company • AD_City
This is what I have tried but not working, hence I post it here for some assistance:
Code: Select all
$MSWord.ActiveDocument.FontName = 'Consolas'
Code: Select all
$MSWord.ActiveDocument.Range.Font.Name = 'Consolas'
Code: Select all
$MSWord.ActiveDocument.Selection.Font.Name = 'Consolas'
Code: Select all
$MSWord.ActiveDocument.Text.Selection.Font= 'Consolas'
Code: Select all
$MSWord.ActiveDocument.Text.Selection.Font.Name = 'Consolas'
Code: Select all
$MSWord.ActiveDocument.Selection.Range.Font.Name = 'Consolas'
Code: Select all
$MSWord.ActiveDocument.Selection.Text.Font.Name = 'Consolas'
However, when I create new MS Word document using the below script, it works:
Code: Select all
$MSWord = New-Object -com word.application
$MSWord.Visible = $True
$Document = $MSWord.Documents.Add()
$Document.Content.Text = "Some Text"
$Document.Content.Font.Name = 'Consolas'
$Document.Content.Font.Size = 12
Thanks in advanced.