Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficeWordEquation

Aliases: WordEquation
Module PSWriteOffice
Aliases
WordEquation
Inputs
OfficeIMO.Word.WordParagraph
Outputs
OfficeIMO.Word.WordParagraph

Adds an Office Math equation to a Word document or paragraph.

Syntax

Add-OfficeWordEquation [-Document <WordDocument>] [-Omml] <String> [-Paragraph <WordParagraph>] [-PassThru] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Accepts OMML and keeps conversion/parsing outside the cmdlet.

Examples

Authored help example

Add an equation to a generated report.

$omml = '<m:oMath xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"><m:r><m:t>x+1</m:t></m:r></m:oMath>'
New-OfficeWord -Path .\Formula.docx {
    Add-OfficeWordParagraph -Text 'The following expression is stored as Office Math.'
    Add-OfficeWordEquation -Omml $omml
}

Inserts prebuilt OMML into the current document; conversion to OMML is intentionally outside the cmdlet.

Parameters

-Document WordDocument optional
Document to receive a new equation paragraph.
-Omml String requiredposition: 0
Office Math Markup Language content.
-Paragraph WordParagraph optionalpipeline: True (ByValue)
Paragraph to receive the equation.
-PassThru SwitchParameter optional
Emit the equation paragraph.

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.