Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficeWordBarcode

Aliases: WordBarcode
Module
PSWriteOffice
Aliases
WordBarcode
Inputs
OfficeIMO.Word.WordParagraph
Outputs
OfficeIMO.Word.WordImage

Adds a QR code or barcode to a Word paragraph.

Syntax

Add-OfficeWordBarcode
[-AlternativeText <String>]
[-BackgroundColor <OfficeColor>]
[-Color <OfficeColor>]
[-ErrorCorrection <L|M|Q|H>]
[-Height <OfficeLength>]
[-NoHumanReadableText]
[-Paragraph <WordParagraph>]
[-PassThru]
[-QuietZone <Int32>]
[-Text] <String>
[-Type <SymbolFormat>]
[-Width <OfficeLength>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

The code is an SVG picture with a PNG fallback, so Word draws it sharply and older readers still show it; OfficeIMO's PDF conversion places it at print resolution. Two-dimensional codes default to 1.25 inches wide; linear barcodes to 0.33 mm per bar module, with their text underneath. The alternative text defaults to the symbology and the encoded text.

Examples

Add a QR code that opens a web page.

New-OfficeWord -Path .\Flyer.docx {
    WordParagraph 'Scan for the event agenda:'
    WordBarcode 'https://evotec.xyz/events'
}

Print an order number as a Code 128 barcode.

WordParagraph { WordText 'Order: '; WordBarcode 'ORD-2026-0042' -Type Code128 -Width 6cm }

Parameters

-AlternativeText String optional
Accessible description; defaults to the symbology and the encoded text.
-BackgroundColor OfficeColor optional
Background and quiet zone color; a literal color.
-Color OfficeColor optional
Color of the bars or dark modules; a literal color such as Black or #1F3864.
-ErrorCorrection QrErrorCorrectionLevel optional
QR error correction level: L, M, Q or H.
Possible values: L, M, Q, H
-Height OfficeLength optional
Height of the whole symbol including human-readable text; numbers mean points.
-NoHumanReadableText SwitchParameter optional
Leave out the human-readable text that linear barcodes print under the bars.
-Paragraph WordParagraph optionalpipeline: True (ByValue)
Target paragraph; the current DSL paragraph, or a new one, is used when omitted.
-PassThru SwitchParameter optional
Return the native editable WordImage.
-QuietZone Int32 optional
Light margin around the symbol, in modules.
-Text String requiredposition: 0
Text, URL or other data to encode.
-Type SymbolFormat optional
Symbology; QR code by default. Any CodeGlyphX format, such as Code128, Ean, UpcA, DataMatrix or Pdf417.
Possible values: QrCode, MicroQrCode, Aztec, Code128, Gs1Code128, Code39, Code93, Ean, UpcA, UpcE, Itf14, Itf, Industrial2Of5, Matrix2Of5, Iata2Of5, PatchCode, Codabar, Msi, Code11, Plessey, Telepen, Pharmacode, PharmacodeTwoTrack, Code32, Postnet, Planet, RoyalMail4State, AustraliaPost, JapanPost, Gs1DataBarTruncated, Gs1DataBarOmnidirectional, Gs1DataBarStacked, Gs1DataBarExpanded, Gs1DataBarExpandedStacked, UspsIntelligentMail, KixCode, DataMatrix, Pdf417, MicroPdf417, RmQrCode, Gs1DataBarLimited, Gs1DataBarStackedOmnidirectional, MaxiCode, DotCode, HanXin, Gs1Composite, Ean2, Ean5, TelepenNumeric, Coop2Of5, Datalogic2Of5, Bc412, FacingIdentificationMark, Daft, Flattermarken, ChannelCode, Code16K, Code49, CodablockF, PosiCode, Mailmark4State, D3Aqr, AztecRune, CodeOne, Ultracode
-Width OfficeLength optional
Width of the whole symbol including its quiet zone; numbers mean points.

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.