Word 365 Normal.dotm

Welcome Forums General PowerShell Q&A Word 365 Normal.dotm

  • This topic has 1 reply, 2 voices, and was last updated 1 week ago by
    Participant
    .
Viewing 1 reply thread
  • Author
    Posts
    • #198344
      MvW
      Participant
      Topics: 8
      Replies: 10
      Points: 84
      Rank: Member

      Hi Guy's,

      I try to modify MS Word 365's Normal.dotm to set a default font and size, but when I start MS Word 365 there is a different default font and size.

       

      $Word = New-Object -ComObject Word.Application
      $Word.Visible = $false
      $NormalDot = "$($env:APPDATA)\Microsoft\Templates\Normal.dotm"
      If (Test-Path $NormalDot -PathType Leaf) {
      $Document = $Word.Documents.Open($NormalDot)
      $NormalDot = "$($env:APPDATA)\Microsoft\Templates\Normal.dotm"
      If (Test-Path $NormalDot -PathType Leaf) {
      $Document = $Word.Documents.Open($NormalDot)
      $Document.Styles(-1).Font.Name = "Arial"
      $Document.Styles(-1).Font.Size = '18'
      $Document.Styles(-1).Font.SetAsTemplateDefault()
      $Document.Styles(-1).ParagraphFormat.SpaceAfter = '0'
      $Document.Styles(-1).ParagraphFormat.LineSpacingRule = [Microsoft.Office.Interop.Word.WdLineSpacing]::wdLineSpaceSingle
      $Document.Close(-1)
      }

       

       

       

    • #198353
      Participant
      Topics: 2
      Replies: 16
      Points: 69
      Helping Hand
      Rank: Member

      Sorry, posted by error ....

      • This reply was modified 1 week ago by TonyD05. Reason: Posted by error
Viewing 1 reply thread
  • You must be logged in to reply to this topic.