Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Get-OfficeWordBookmark

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

Gets bookmarks from a Word document.

Remarks

Returns WordBookmark objects, optionally filtered by name.

Examples

Authored help example

List report bookmarks by name pattern.

PS>


$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.

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.

Syntax

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

Parameters

Name String[] optionalposition: namedpipeline: False
Bookmark name filter (wildcards supported).
Path String requiredposition: 0pipeline: Falsealiases: FilePath, InputPath
Path to the .docx file.

Outputs

OfficeIMO.Word.WordBookmark

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

Parameters

Document WordDocument requiredposition: namedpipeline: True (ByValue)
Word document to read.
Name String[] optionalposition: namedpipeline: False
Bookmark name filter (wildcards supported).

Outputs

OfficeIMO.Word.WordBookmark