Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Get-OfficeWordBookmark

Module
PSWriteOffice
Inputs
OfficeIMO.Word.WordDocument
Outputs
OfficeIMO.Word.WordBookmark

Gets bookmarks from a Word document.

Syntax

Get-OfficeWordBookmark
[-Name <String[]>]
[-Path] <String>
[<CommonParameters>]
#
Parameter set: Path
Get-OfficeWordBookmark
-Document <WordDocument>
[-Name <String[]>]
[<CommonParameters>]
#
Parameter set: Document

Description

Returns WordBookmark objects, optionally filtered by name.

Examples

List report bookmarks by name pattern.

$bookmarks = Get-OfficeWordBookmark -Path .\Report.docx -Name 'Appendix*', 'ExecutiveSummary'
$bookmarks |
    Select-Object -Property Name |
    Format-Table -AutoSize

Loads the document read-only, filters bookmark names with wildcards, and displays the matching navigation targets.

Parameters

-Name String[] optional
Bookmark name filter (wildcards supported).
-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path
Path to the .docx file.
-Document WordDocument requiredpipeline: True (ByValue)sets: Document
Word document to read.

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.