# Update Existing Word Documents

Replace content and modify targeted Word structures while preserving the rest of an existing DOCX document.

Updating an existing document is different from rebuilding it. Use the smallest command that owns the intended change, preserve the original as input when auditability matters, and reopen the result to verify the change.

## Replace text and link metadata

`Update-OfficeWordText` can update visible text and, when explicitly selected, hyperlink text, URI, anchor, and tooltip metadata.

```powershell
Update-OfficeWordText -Path '.\Input\FY24-Report.docx' `
    -OldValue 'FY24' -NewValue 'FY25' `
    -IncludeHyperlinkText -IncludeHyperlinkUri `
    -IncludeHyperlinkAnchor -IncludeHyperlinkTooltip
```

Use `-WhatIf` before a broad replacement. `Get-OfficeWordParagraph` can count the old and new values before and after the operation.

## Modify live objects

For structural work, open an editable document and pipe the specific object to commands such as `Set-OfficeWordParagraph`, `Set-OfficeWordText`, `Set-OfficeWordTableCell`, `Set-OfficeWordImage`, or `Set-OfficeWordDocumentProperty`. Save or close with `-Save` only after all changes succeed.

The [update-existing recipe](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/PowerShell/PSWriteOffice/Examples/Word/Recipe-Word-UpdateExisting.ps1) demonstrates link-aware replacement. [Example-WordModifyExistingObjects.ps1](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/PowerShell/PSWriteOffice/Examples/Word/Example-WordModifyExistingObjects.ps1) shows object-level changes.

## Preserve intent

A targeted update should not silently restructure unrelated content. For large template changes, create a new version and use [Word comparison and review](/docs/pswriteoffice/word-review-delivery/) instead of treating a complex rewrite as a text replacement.

<!-- PowerForge markdown source sha256:62866A20AA26A00AC463BF93963FA5EFC6F0319B418D91B4783BF8B0E14484D2; title=True -->

<!-- PowerForge markdown artifact sha256:DD0F028E593261CE816D1D8432C9CE8435CF164EFA93804DD2241ACA2CB4F975 -->
