Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Read-OfficeDocument

Module
PSWriteOffice
Inputs
OfficeIMO.Reader.OfficeDocumentReadResult System.String[]
Outputs
OfficeIMO.Reader.OfficeDocumentReadResult System.String OfficeIMO.Reader.OfficeDocumentPageText OfficeIMO.Reader.OfficeDocumentPageMarkdown OfficeIMO.Reader.ReaderChunk OfficeIMO.Reader.ReaderChunkHierarchyResult OfficeIMO.Reader.OfficeDocumentStructuredExtractionResult OfficeIMO.Reader.ReaderTable OfficeIMO.Reader.ReaderTableExportBundle OfficeIMO.Reader.ReaderVisual OfficeIMO.Reader.ReaderVisualExportBundle OfficeIMO.Reader.OfficeDocumentAsset OfficeIMO.Reader.ReaderIngestResult OfficeIMO.Pdf.Ocr.PdfSearchableOcrReview

Reads supported documents once and projects text, structure or ingestion views.

Syntax

Read-OfficeDocument
[[-As] <OfficeReadView>]
[-Bundle]
[-ByPage]
[-ChunkRows <Int32>]
[-Extension <String[]>]
[-HierarchyOptions <ReaderHierarchicalChunkingOptions>]
[-IncludePageLocations]
[-Indented]
[-MaximumChunkCharacters <Int32>]
[-MaximumFiles <Int32>]
[-MaximumInputBytes <Int64>]
[-MaximumStoreItems <Int32>]
[-MaximumTableRows <Int32>]
[-MaximumTotalBytes <Int64>]
[-MaximumXmlCharactersInPart <Int64>]
[-NoChunks]
[-NoFootnotes]
[-NoHashes]
[-NoHeaderRow]
[-NoHeadingChunks]
[-NoNotes]
[-NoPageMarkers]
[-Ocr]
[-OcrOptions <OfficeOcrOptions>]
[-Options <Object[]>]
[-Password <SecureString>]
[-Path] <String[]>
[-Range <String>]
[-Reader <OfficeDocumentReader>]
[-Recurse]
[-Sheet <OfficeSheetSelector>]
[-StructureOptions <OfficeDocumentStructuredExtractionOptions>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]
#
Parameter set: Path
Read-OfficeDocument
[[-As] <OfficeReadView>]
[-Bundle]
[-ByPage]
[-HierarchyOptions <ReaderHierarchicalChunkingOptions>]
[-Indented]
[-InputObject] <OfficeDocumentReadResult>
[-NoChunks]
[-NoPageMarkers]
[-StructureOptions <OfficeDocumentStructuredExtractionOptions>]
[<CommonParameters>]
#
Parameter set: InputObject
Read-OfficeDocument
[[-As] <OfficeReadView>]
[-Bundle]
[-ByPage]
[-ChunkRows <Int32>]
[-Extension <String[]>]
[-HierarchyOptions <ReaderHierarchicalChunkingOptions>]
[-IncludePageLocations]
[-Indented]
-LiteralPath <String[]>
[-MaximumChunkCharacters <Int32>]
[-MaximumFiles <Int32>]
[-MaximumInputBytes <Int64>]
[-MaximumStoreItems <Int32>]
[-MaximumTableRows <Int32>]
[-MaximumTotalBytes <Int64>]
[-MaximumXmlCharactersInPart <Int64>]
[-NoChunks]
[-NoFootnotes]
[-NoHashes]
[-NoHeaderRow]
[-NoHeadingChunks]
[-NoNotes]
[-NoPageMarkers]
[-Ocr]
[-OcrOptions <OfficeOcrOptions>]
[-Options <Object[]>]
[-Password <SecureString>]
[-Range <String>]
[-Reader <OfficeDocumentReader>]
[-Recurse]
[-Sheet <OfficeSheetSelector>]
[-StructureOptions <OfficeDocumentStructuredExtractionOptions>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]
#
Parameter set: LiteralPath

Examples

Read a folder as text.

Read-OfficeDocument ./Reports -Recurse -As Text

Reuse a read result without opening its source again.

$document = Read-OfficeDocument ./Report.docx
$document | Read-OfficeDocument -As Tables

Parameters

-As OfficeReadView optionalposition: 1
Representation to return. Document is the default.
Possible values: Document, Text, Markdown, Json, Chunks, Hierarchy, Structure, Tables, Visuals, Assets, Ingest, Ocr
-Bundle SwitchParameter optional
Return in-memory table or visual export bundles.
-ByPage SwitchParameter optional
Return one text or Markdown object for each observed page, slide or worksheet.
-ChunkRows Int32 optionalsets: Path, LiteralPath
Spreadsheet source rows per chunk.
-Extension String[] optionalsets: Path, LiteralPath
Selected source extensions, with or without a leading dot.
-HierarchyOptions ReaderHierarchicalChunkingOptions optional
Hierarchical chunking policy.
-IncludePageLocations SwitchParameter optionalsets: Path, LiteralPath
Compute page locations where the native format does not store them.
-Indented SwitchParameter optional
Indent JSON output.
-MaximumChunkCharacters Int32 optionalsets: Path, LiteralPath
Maximum characters per source chunk.
-MaximumFiles Int32 optionalsets: Path, LiteralPath
Maximum selected files; zero means no limit.
-MaximumInputBytes Int64 optionalsets: Path, LiteralPath
Maximum bytes per source. Native owner limits still apply.
-MaximumStoreItems Int32 optionalsets: Path, LiteralPath
Maximum items per mail store; zero means all.
-MaximumTableRows Int32 optionalsets: Path, LiteralPath
Maximum rows per table chunk.
-MaximumTotalBytes Int64 optionalsets: Path, LiteralPath
Maximum combined source bytes accepted in this read batch.
-MaximumXmlCharactersInPart Int64 optionalsets: Path, LiteralPath
Maximum XML characters in one Office package part.
-NoChunks SwitchParameter optional
Omit chunks from an ingestion summary.
-NoFootnotes SwitchParameter optionalsets: Path, LiteralPath
Exclude Word footnotes.
-NoHashes SwitchParameter optionalsets: Path, LiteralPath
Do not compute source and chunk hashes.
-NoHeaderRow SwitchParameter optionalsets: Path, LiteralPath
Treat the first spreadsheet row as data.
-NoHeadingChunks SwitchParameter optionalsets: Path, LiteralPath
Do not split Markdown at headings.
-NoNotes SwitchParameter optionalsets: Path, LiteralPath
Exclude PowerPoint speaker notes.
-NoPageMarkers SwitchParameter optional
Omit portable page markers from Markdown.
-Ocr SwitchParameter optionalsets: Path, LiteralPath
Recognize text in source images and scanned pages using an optional OCR engine.
-OcrOptions OfficeOcrOptions optionalsets: Path, LiteralPath
Optional OCR provider and native recognition policies. Implies Ocr.
-Options Object[] optionalsets: Path, LiteralPath
Typed common and format read options, or common/format-keyed hashtables.
-Password SecureString optionalsets: Path, LiteralPath
Open password for encrypted sources.
-Path String[] requiredposition: 0pipeline: True (ByValue)sets: Path
Gets or sets input paths with provider wildcard expansion.
-Range String optionalsets: Path, LiteralPath
A1 range within each selected worksheet.
-Reader OfficeDocumentReader optionalsets: Path, LiteralPath
Caller-configured immutable Reader.
-Recurse SwitchParameter optionalsets: Path, LiteralPath
Include subfolders.
-Sheet OfficeSheetSelector optionalsets: Path, LiteralPath
Spreadsheet worksheet name, one-based position or sheet object.
-StructureOptions OfficeDocumentStructuredExtractionOptions optional
Structured extraction policy.
-ThrottleLimit Int32 optionalsets: Path, LiteralPath
Gets or sets the maximum number of concurrent background operations.
-InputObject OfficeDocumentReadResult requiredposition: 0pipeline: True (ByValue)sets: InputObject
Already read document; its source is never reopened.
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath
Gets or sets input paths without wildcard expansion, binding FileInfo.FullName and provider PSPath.

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.