Setting Default Font and Font Size in Microsoft Word via Intune

Anthony Lauckner 0 Reputation points
2024-08-29T14:26:23.06+00:00

HI everyone,

I would like to know how to set a default font and font size in Microsoft Word via Intune for a Windows environment. Are there specific steps or settings to apply these configurations in Word through Intune? I’ve tried using a PowerShell script on a local machine, which works fine, but I haven’t been able to get it to work through Intune.


$templatePath = "$env:APPDATA\Microsoft\Templates\Normal.dotm"

$word = New-Object -ComObject Word.Application

$word.Visible = $false

try {

if (Test-Path -Path $templatePath) {

    $template = $word.Documents.Open($templatePath)

} else {

    $template = $word.Documents.Add()

    $template.SaveAs([ref] $templatePath, [ref] 1)

}

$style = $template.Styles.Item("Normal")

$style.Font.Name = "Neue Haas Grotesk"

$style.Font.Size = 11

$template.Save()

$template.Close()

} catch {

Write-Error "Problem : $_"

} finally {

$word.Quit()

[System.Runtime.InteropServices.Marshal]::ReleaseComObject($template) | Out-Null

[System.Runtime.InteropServices.Marshal]::ReleaseComObject($word) | Out-Null

Remove-Variable -Name word

Remove-Variable -Name template

}

Set-ExecutionPolicy Bypass -Scope Process -Force

Thank you for your help.

Best regards,

Microsoft Intune MacOs
Microsoft Intune MacOs
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.MacOs: A family of Apple operating systems for the Apple Mac line of computers.
93 questions
Microsoft Intune Application management
Microsoft Intune Application management
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Application management: The process of creating, configuring, managing, and monitoring applications.
969 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xenia-MSFT 3,140 Reputation points Microsoft Vendor
    2024-08-30T01:28:53.02+00:00

    @Anthony Lauckner Thanks for posting in our Q&A. From your description, did you mean that this script works when you run it manually, but it doesn't work when you deployed it via intune? If there is anything misunderstanding, please correct me.

    For this issue, we appreciate your help to collect some information:

    1.Please show us the screen shot of Script settings in intune portal.

    2.Please try to run the scripts in the System account using the psexec tool locally to check if this script still works.

    psexec -i -s

    https://learn.microsoft.com/en-us/sysinternals/downloads/psexec

    If there is anything update, feel free to let us know.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.