Cmdlet
Add-OfficeWordHeading
Adds a heading using the document's built-in heading, title or subtitle style.
Syntax
Add-OfficeWordHeading
[-Alignment <OfficeAlignment>]
[-Document <WordDocument>]
[-Level <WordHeadingLevel>]
[-PassThru]
[-Text] <String>
[<CommonParameters>]#Parameter set:
TextAdd-OfficeWordHeading
[-Alignment <OfficeAlignment>]
[-Content] <ScriptBlock>
[-Document <WordDocument>]
[-Level <WordHeadingLevel>]
[-PassThru]
[<CommonParameters>]#Parameter set:
ContentDescription
Levels 1–9 participate in document navigation and tables of contents. A content block accepts WordText runs.
Examples
Add a heading hierarchy.
WordHeading 'Service review'
WordHeading 'Availability' -Level 2Add a rich heading to a live document.
Add-OfficeWordHeading -Document $document -Level 2 { WordText 'Open incidents '; WordText '(3)' -Bold }Parameters
- -Alignment OfficeAlignment
- Optional horizontal alignment.
- Possible values:
Left,Center,Right,Justify,Start,End - -Document WordDocument
- Live document; omitted inside a Word content block.
- -Level WordHeadingLevel
- Heading level 1–9, Title or Subtitle. Defaults to Heading1.
- Possible values:
Heading1,Heading2,Heading3,Heading4,Heading5,Heading6,Heading7,Heading8,Heading9,Title,Subtitle - -PassThru SwitchParameter
- Emit the object created or changed by the command.
- -Text String
- Heading text.
- -Content ScriptBlock
- Rich heading content composed with WordText.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.