Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PowerPointDocument

OfficeIMO.PowerPoint

Namespace
OfficeIMO.PowerPoint
Assembly
OfficeIMO.PowerPoint
Source revision
e163ccb36643 with working tree changes
Implements
IDisposable IAsyncDisposable
Modifiers
sealed

Represents a PowerPoint presentation providing create, load, and save operations.

Inheritance

  • object
  • PowerPointDocument

Usage

Explore 12 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 7

Methods

public PowerPointClassicComment AddClassicComment(PowerPointSlide slide, PowerPointCommentAuthor author, string text, OfficeLength x = default, OfficeLength y = default, DateTime? created = null) #

Adds a classic comment that can round-trip through PPTX and binary PPT.

Parameters

slide OfficeIMO.PowerPoint.PowerPointSlide required
author OfficeIMO.PowerPoint.PowerPointCommentAuthor required
text string required
x OfficeIMO.OfficeLength = default optional
y OfficeIMO.OfficeLength = default optional
created System.DateTime? = null optional
public IReadOnlyList<PowerPointGuideInfo> AddColumnGuides(int columnCount, OfficeLength margin, OfficeLength gutter, bool includeOuterEdges = true, bool clearExisting = false) #

Adds vertical column guides based on a grid definition.

Parameters

columnCount int required
margin OfficeIMO.OfficeLength required
gutter OfficeIMO.OfficeLength required
includeOuterEdges bool = true optional
clearExisting bool = false optional

Returns

IReadOnlyList<PowerPointGuideInfo>
public PowerPointCustomShow AddCustomShow(string name, IEnumerable<PowerPointSlide> slides) #

Creates a custom show with an explicit, nonempty slide sequence.

Parameters

name string required
slides System.Collections.Generic.IEnumerable<OfficeIMO.PowerPoint.PowerPointSlide> required
public PowerPointGuideInfo AddGuide(PowerPointGuideOrientation orientation, OfficeLength position) #

Adds a guide to slide view.

Parameters

orientation OfficeIMO.PowerPoint.PowerPointGuideOrientation required
position OfficeIMO.OfficeLength required
public PowerPointModernComment AddModernComment(PowerPointSlide slide, PowerPointCommentAuthor author, string text, PowerPointModernCommentStatus status = Active, OfficeLength x = default, OfficeLength y = default, DateTime? created = null) #

Adds a modern threaded comment to a slide.

Parameters

slide OfficeIMO.PowerPoint.PowerPointSlide required
author OfficeIMO.PowerPoint.PowerPointCommentAuthor required
text string required
status OfficeIMO.PowerPoint.PowerPointModernCommentStatus = Active optional
x OfficeIMO.OfficeLength = default optional
y OfficeIMO.OfficeLength = default optional
created System.DateTime? = null optional
public IReadOnlyList<PowerPointGuideInfo> AddRowGuides(int rowCount, OfficeLength margin, OfficeLength gutter, bool includeOuterEdges = true, bool clearExisting = false) #

Adds horizontal row guides based on a grid definition.

Parameters

rowCount int required
margin OfficeIMO.OfficeLength required
gutter OfficeIMO.OfficeLength required
includeOuterEdges bool = true optional
clearExisting bool = false optional

Returns

IReadOnlyList<PowerPointGuideInfo>
public PowerPointSectionInfo AddSection(string name, int startSlideIndex) #

Adds a new section starting at the specified slide index.

Parameters

name string required
startSlideIndex int required
AddSlide 4 overloads
public PowerPointSlide AddSlide(PowerPointSlideLayoutType layoutType, int masterIndex = 0) #

Adds a slide using a layout type.

Parameters

layoutType OfficeIMO.PowerPoint.PowerPointSlideLayoutType required
masterIndex int = 0 optional
public PowerPointSlide AddSlide(string layoutName, int masterIndex = 0, bool ignoreCase = true) #

Adds a slide using a layout name.

Parameters

layoutName string required
masterIndex int = 0 optional
ignoreCase bool = true optional
public PowerPointSlide AddSlide(int masterIndex = 0, int layoutIndex = 0) #

Adds a new slide using the specified master and layout indexes.

Parameters

masterIndex int = 0 optional
Index of the slide master.
layoutIndex int = 0 optional
Index of the slide layout.
public PowerPointSlide AddSlide(PowerPointTemplateLayoutInfo layout) #

Adds a slide using a layout selected from a template inventory.

Parameters

layout OfficeIMO.PowerPoint.PowerPointTemplateLayoutInfo required
public IReadOnlyList<PowerPointSlide> AddSlides(int count, int masterIndex = 0, int layoutIndex = 0, CancellationToken cancellationToken = default) #

Adds slides in source order using one layout, with one presentation-list save for the batch.

Parameters

count int required
The number of slides to add.
masterIndex int = 0 optional
Index of the slide master.
layoutIndex int = 0 optional
Index of the slide layout.
cancellationToken System.Threading.CancellationToken = default optional
Cancels between completed slide additions.

Returns

IReadOnlyList<PowerPointSlide>
public PowerPointPaginatedTableResult AddTableSlides<T>(IEnumerable<T?> data, IEnumerable<PowerPointTableColumn<T?>> columns, PowerPointTablePaginationOptions? options = null) #

Adds as many slides as required to represent every data row in native PowerPoint tables. Capacity is measured from the table box and minimum row height, and headers repeat by default.

Type Parameters

T

Parameters

data System.Collections.Generic.IEnumerable<T?> required
columns System.Collections.Generic.IEnumerable<OfficeIMO.PowerPoint.PowerPointTableColumn<T?>> required
options OfficeIMO.PowerPoint.PowerPointTablePaginationOptions? = null optional
public LegacyPptWritePreflightReport AnalyzeLegacyPptWrite() #

Analyzes whether this presentation fits the native binary PPT/POT/PPS writer subset.

public void ApplyTheme(OfficeTheme theme, int? masterIndex = null) #

Restyles a presentation's theme and master text styles. Presentations created by OfficeIMO also get their master placeholders and layouts rewritten; a loaded presentation keeps its shapes, backgrounds and placeholders.

Parameters

theme OfficeIMO.OfficeTheme required
Theme to apply. Explicit shape formatting is retained.
masterIndex int? = null optional
Zero-based master to restyle, or null for every master and the presentation defaults.
public void ClearGuides() #

Clears all guides from slide view.

public void ClearSlides() #

Removes all slides while preserving reusable template masters, layouts, themes, and assets.

public PowerPointCompositionResult Compose(PowerPointDeckPlan plan, PowerPointCompositionOptions options) #

Composes a semantic deck plan into this presentation through the single shared layout engine.

Parameters

plan OfficeIMO.PowerPoint.PowerPointDeckPlan required
Semantic slide intent to render.
options OfficeIMO.PowerPoint.PowerPointCompositionOptions required
Design, continuation, template-layout, validation, and preflight policy.

Returns

PowerPointCompositionResult The resolved plan, design, rendered slides, and preflight report.
Create 3 overloads
public static PowerPointDocument Create(PowerPointCreateOptions? options = null) #

Creates a detached presentation with explicit persistence.

Parameters

options OfficeIMO.PowerPoint.PowerPointCreateOptions? = null optional
public static PowerPointDocument Create(string filePath, PowerPointCreateOptions? options = null) #

Creates a new presentation associated with a file path. The path is not created until PowerPointDocument.Save is called or SaveOnDispose is explicitly enabled.

Parameters

filePath string required
options OfficeIMO.PowerPoint.PowerPointCreateOptions? = null optional
public static PowerPointDocument Create(Stream stream, PowerPointCreateOptions? options = null) #

Creates a new presentation associated with a caller-owned stream. The stream is not written until PowerPointDocument.Save is called or SaveOnDispose is explicitly enabled.

Parameters

stream System.IO.Stream required
options OfficeIMO.PowerPoint.PowerPointCreateOptions? = null optional
public void Dispose() #

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public async ValueTask DisposeAsync() #

Asynchronously persists opt-in changes and releases package resources.

Returns

ValueTask
public PowerPointSlide DuplicateSlide(int index, int? insertAt = null) #

Duplicates a slide and inserts it into the presentation.

Parameters

index int required
Index of the slide to duplicate.
insertAt int? = null optional
Index where the duplicate should be inserted. Defaults to index + 1.
public PowerPointTextBox EnsureLayoutDateTimePlaceholderTextBox(int masterIndex = 0, int layoutIndex = 0, string? text = null, PowerPointLayoutBox? bounds = null, uint? index = null) #

Ensures a native date/time placeholder exists on the specified slide layout.

Parameters

masterIndex int = 0 optional
layoutIndex int = 0 optional
text string? = null optional
bounds OfficeIMO.PowerPoint.PowerPointLayoutBox? = null optional
index uint? = null optional
public PowerPointTextBox EnsureLayoutFooterPlaceholderTextBox(int masterIndex = 0, int layoutIndex = 0, string? text = null, PowerPointLayoutBox? bounds = null, uint? index = null) #

Ensures a native footer placeholder exists on the specified slide layout.

Parameters

masterIndex int = 0 optional
layoutIndex int = 0 optional
text string? = null optional
bounds OfficeIMO.PowerPoint.PowerPointLayoutBox? = null optional
index uint? = null optional
public IReadOnlyList<PowerPointTextBox> EnsureLayoutHeaderFooterPlaceholders(int masterIndex = 0, int layoutIndex = 0, string? footerText = null, string? dateTimeText = null, string? slideNumberText = null) #

Ensures native footer, date/time, and slide-number placeholders exist on the specified slide layout.

Parameters

masterIndex int = 0 optional
layoutIndex int = 0 optional
footerText string? = null optional
dateTimeText string? = null optional
slideNumberText string? = null optional

Returns

IReadOnlyList<PowerPointTextBox>
public PowerPointTextBox EnsureLayoutPlaceholderTextBox(int masterIndex, int layoutIndex, PowerPointPlaceholderType placeholderType, uint? index = null, PowerPointLayoutBox? bounds = null, string? name = null) #

Ensures a layout placeholder textbox exists, creating it if missing.

Parameters

masterIndex int required
layoutIndex int required
placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType required
index uint? = null optional
bounds OfficeIMO.PowerPoint.PowerPointLayoutBox? = null optional
name string? = null optional
public PowerPointTextBox EnsureLayoutSlideNumberPlaceholderTextBox(int masterIndex = 0, int layoutIndex = 0, string? text = null, PowerPointLayoutBox? bounds = null, uint? index = null) #

Ensures a native slide-number placeholder exists on the specified slide layout.

Parameters

masterIndex int = 0 optional
layoutIndex int = 0 optional
text string? = null optional
bounds OfficeIMO.PowerPoint.PowerPointLayoutBox? = null optional
index uint? = null optional
ExportImages 2 overloads
public IReadOnlyList<OfficeImageExportResult> ExportImages(OfficeImageExportFormat format, PowerPointImageExportOptions? options = null) #

Exports presentation slides as supported raster formats or SVG images.

Parameters

format OfficeIMO.Drawing.OfficeImageExportFormat required
options OfficeIMO.PowerPoint.PowerPointImageExportOptions? = null optional

Returns

IReadOnlyList<OfficeImageExportResult>
public void ExportImages(OfficeImageExportFormat format, OfficeImageExportConsumer consumer, PowerPointImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Streams selected slide images to a consumer without retaining earlier payloads.

Parameters

format OfficeIMO.Drawing.OfficeImageExportFormat required
consumer OfficeIMO.Drawing.OfficeImageExportConsumer required
options OfficeIMO.PowerPoint.PowerPointImageExportOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional
ExportSlide 2 overloads
public void ExportSlide(int slideIndex, string filePath) #

Exports a single slide as a standalone one-slide PowerPoint presentation.

Parameters

slideIndex int required
Zero-based index of the slide to export.
filePath string required
Destination .pptx path.
public void ExportSlide(int slideIndex, Stream destination) #

Exports a single slide as a standalone one-slide PowerPoint presentation.

Parameters

slideIndex int required
Zero-based index of the slide to export.
destination System.IO.Stream required
Writable destination stream.
public IReadOnlyList<PowerPointClassicComment> GetClassicComments(PowerPointSlide slide) #

Returns editable classic comments for a slide.

Parameters

slide OfficeIMO.PowerPoint.PowerPointSlide required

Returns

IReadOnlyList<PowerPointClassicComment>
public PowerPointCustomShow? GetCustomShow(string name) #

Finds a custom show by name using ordinal, case-insensitive matching.

Parameters

name string required
GetEmbeddedPayloads 2 overloads
public IReadOnlyList<OfficeEmbeddedPayloadInfo> GetEmbeddedPayloads(OfficeEmbeddedPayloadInspectionOptions options, CancellationToken cancellationToken = default) #

Inventories payloads within explicit count/member/aggregate/work ceilings without scanning unrequested bytes unless hashing is requested.

Parameters

options OfficeIMO.OfficeEmbeddedPayloadInspectionOptions required
cancellationToken System.Threading.CancellationToken = default optional

Returns

IReadOnlyList<OfficeEmbeddedPayloadInfo>
public IReadOnlyList<OfficeEmbeddedPayloadInfo> GetEmbeddedPayloads(bool includeSha256 = false) #

Gets inert embedded package, OLE and ActiveX descriptors from the loaded presentation.

Parameters

includeSha256 bool = false optional

Returns

IReadOnlyList<OfficeEmbeddedPayloadInfo>
public IReadOnlyList<PowerPointGuideInfo> GetGuides() #

Returns the current guides defined for slide view.

Returns

IReadOnlyList<PowerPointGuideInfo>
GetLayoutIndex 2 overloads
public int GetLayoutIndex(PowerPointSlideLayoutType layoutType, int masterIndex = 0) #

Finds a layout index by layout type.

Parameters

layoutType OfficeIMO.PowerPoint.PowerPointSlideLayoutType required
masterIndex int = 0 optional

Returns

int
public int GetLayoutIndex(string layoutName, int masterIndex = 0, bool ignoreCase = true) #

Finds a layout index by layout name.

Parameters

layoutName string required
masterIndex int = 0 optional
ignoreCase bool = true optional

Returns

int
public PowerPointTextBox? GetLayoutPlaceholderTextBox(int masterIndex, int layoutIndex, PowerPointPlaceholderType placeholderType, uint? index = null) #

Retrieves a layout placeholder textbox for a master/layout pair.

Parameters

masterIndex int required
layoutIndex int required
placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType required
index uint? = null optional
public IReadOnlyList<PowerPointModernComment> GetModernComments(PowerPointSlide slide) #

Returns editable modern comments for a slide.

Parameters

slide OfficeIMO.PowerPoint.PowerPointSlide required

Returns

IReadOnlyList<PowerPointModernComment>
public IReadOnlyList<PowerPointSectionInfo> GetSections() #

Returns the sections defined in the presentation.

Returns

IReadOnlyList<PowerPointSectionInfo>
public IReadOnlyList<PowerPointSlideLayoutInfo> GetSlideLayouts(int masterIndex = 0) #

Returns the layouts available for a slide master.

Parameters

masterIndex int = 0 optional

Returns

IReadOnlyList<PowerPointSlideLayoutInfo>
public OfficeTheme GetTheme(int masterIndex = 0) #

Reads a master's theme name, current palette and Latin heading/body fonts without restyling the presentation.

Parameters

masterIndex int = 0 optional
Zero-based master position.

Returns

OfficeTheme
public string? GetThemeColor(PowerPointThemeColor color, int masterIndex = 0) #

Gets a theme color value in hex format (e.g. "FF0000").

Parameters

color OfficeIMO.PowerPoint.PowerPointThemeColor required
masterIndex int = 0 optional

Returns

string?
public IReadOnlyDictionary<PowerPointThemeColor, string> GetThemeColors(int masterIndex = 0) #

Returns the theme colors that are defined on the master.

Parameters

masterIndex int = 0 optional

Returns

IReadOnlyDictionary<PowerPointThemeColor, string>
public PowerPointThemeFontSet GetThemeFonts(int masterIndex = 0) #

Gets the major/minor fonts (Latin, East Asian, and complex script).

Parameters

masterIndex int = 0 optional
public PowerPointThemeFontInfo GetThemeLatinFonts(int masterIndex = 0) #

Gets the major/minor Latin fonts for the theme.

Parameters

masterIndex int = 0 optional
public byte[]? GetVbaProjectBytes(long maximumBytes = 67108864) #

Reads the exact embedded VBA compound storage without changing the caller-visible package.

Parameters

maximumBytes long = 67108864 optional

Returns

byte[]?
public PowerPointSlide ImportSlide(PowerPointDocument sourcePresentation, int sourceIndex, int? insertAt = null) #

Imports a slide from another presentation and inserts it into the current presentation.

Parameters

sourcePresentation OfficeIMO.PowerPoint.PowerPointDocument required
Presentation to import from.
sourceIndex int required
Index of the slide to import.
insertAt int? = null optional
Index where the imported slide should be inserted. Defaults to end.
public IReadOnlyList<PowerPointSlide> ImportSlides(PowerPointDocument sourcePresentation, IEnumerable<int> sourceIndices, int? insertAt = null) #

Imports selected slides together, preserving links between them without duplicate imports.

Parameters

sourcePresentation OfficeIMO.PowerPoint.PowerPointDocument required
The source document, which may also be this document.
sourceIndices System.Collections.Generic.IEnumerable<int> required
Zero-based source positions, in the requested order. Repeated positions are imported once.
insertAt int? = null optional
Zero-based insertion position; omission appends.

Returns

IReadOnlyList<PowerPointSlide> The requested native slides in selection order. Linked dependencies are imported once after them.
public PowerPointInspectionReport Inspect(PowerPointInspectionOptions? options = null) #

Runs a coherent set of inspections over the current presentation without changing it.

Parameters

options OfficeIMO.PowerPoint.PowerPointInspectionOptions? = null optional
public PowerPointAccessibilityReport InspectAccessibility(PowerPointAccessibilityOptions? options = null) #

Inspects generated or imported slides against a structured accessibility policy.

Parameters

options OfficeIMO.PowerPoint.PowerPointAccessibilityOptions? = null optional
InspectAnimations 2 overloads
public PowerPointAnimationReport InspectAnimations() #

Inspects slide timing trees before any animation authoring is attempted.

public PowerPointAnimationReport InspectAnimations(PowerPointAnimationInspectionOptions options) #

Inspects slide timing trees with explicit traversal and result limits.

Parameters

options OfficeIMO.PowerPoint.PowerPointAnimationInspectionOptions required
public OfficeEmbeddedPayloadInspection InspectEmbeddedPayloads(OfficeEmbeddedPayloadInspectionOptions? options = null, CancellationToken cancellationToken = default) #

Inventories inert native payloads and creates a bounded cumulative read session. Keep this presentation open for new reads; returned streams are detached and caller-owned.

Parameters

options OfficeIMO.OfficeEmbeddedPayloadInspectionOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

OfficeEmbeddedPayloadInspection
public PowerPointFeatureReport InspectFeatures() #

Inspects presentation features and reports which ones OfficeIMO can edit, partially edit, preserve, or does not support yet.

public OfficeContentSafetyReport InspectLoadedContentSafety(OfficeContentSafetyOptions? options = null, CancellationToken cancellationToken = default) #

Inspects the currently loaded presentation without reopening, saving or running content. Source-load limits remain the caller's responsibility.

Parameters

options OfficeIMO.ContentSafety.OfficeContentSafetyOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

OfficeContentSafetyReport
public PowerPointDeckPreflightReport InspectPreflight(PowerPointDeckPreflightOptions? options = null) #

Inspects authored slide bounds, measured text fit, peer collisions, image relationships, and shared visual-snapshot diagnostics without changing the presentation.

Parameters

options OfficeIMO.PowerPoint.PowerPointDeckPreflightOptions? = null optional
InspectReviewComments 2 overloads
public PowerPointReviewReport InspectReviewComments() #

Inspects classic and modern comments without mutating review markup.

public PowerPointReviewReport InspectReviewComments(CancellationToken cancellationToken) #

Inspects native comment threads with cancellation between slides, comments and replies.

Parameters

cancellationToken System.Threading.CancellationToken required
public PowerPointSignatureReport InspectSignatures() #

Inspects package signature metadata without mutating it.

public OfficeVbaProjectInfo? InspectVbaProject(bool includeSha256 = false, long maxBytes = 67108864) #

Inspects attached VBA metadata without executing code, within an explicit decoded-size limit.

Parameters

includeSha256 bool = false optional
maxBytes long = 67108864 optional

Returns

OfficeVbaProjectInfo?
public OfficeVbaProjectInfo? InspectVbaProjectMetadata() #

Inventories the VBA part and signature relationship without reading its bytes or decoding module names. Payload length remains unknown.

Returns

OfficeVbaProjectInfo?
public PowerPointVisualProofReport InspectVisuals(string sourceKind = "generated") #

Creates structural, extraction, accessibility, PNG, SVG, and snapshot proof for every slide.

Parameters

sourceKind string = "generated" optional
Load 6 overloads
public static PowerPointDocument Load(string filePath, PowerPointLoadOptions? options = null) #

Loads an existing presentation into detached memory.

Parameters

filePath string required
options OfficeIMO.PowerPoint.PowerPointLoadOptions? = null optional
public static PowerPointDocument Load(string filePath, PowerPointLoadOptions? options, CancellationToken cancellationToken) #

Loads an existing presentation into detached memory with cancellation.

Parameters

filePath string required
options OfficeIMO.PowerPoint.PowerPointLoadOptions? required
cancellationToken System.Threading.CancellationToken required
public static PowerPointDocument Load(Stream stream, PowerPointLoadOptions? options = null) #

Loads a presentation from a caller-owned stream into memory. Editable writable seekable sources become the associated destination; other sources remain detached.

Parameters

stream System.IO.Stream required
options OfficeIMO.PowerPoint.PowerPointLoadOptions? = null optional
public static PowerPointDocument Load(Stream stream, PowerPointLoadOptions? options, CancellationToken cancellationToken) #

Loads a presentation from a caller-owned stream into memory with cancellation.

Parameters

stream System.IO.Stream required
options OfficeIMO.PowerPoint.PowerPointLoadOptions? required
cancellationToken System.Threading.CancellationToken required
public static PowerPointDocument Load(string path, PowerPointLoadOptions? options, out OfficeConversionReport report) #

Loads a presentation and returns findings from its source projection.

Parameters

path string required
options OfficeIMO.PowerPoint.PowerPointLoadOptions? required
report OfficeIMO.OfficeConversionReport required
public static PowerPointDocument Load(Stream stream, PowerPointLoadOptions? options, out OfficeConversionReport report) #

Loads a presentation stream and returns findings from its source projection.

Parameters

stream System.IO.Stream required
options OfficeIMO.PowerPoint.PowerPointLoadOptions? required
report OfficeIMO.OfficeConversionReport required
LoadAsync 2 overloads
public static async Task<PowerPointDocument> LoadAsync(string filePath, PowerPointLoadOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously loads an existing presentation into detached memory.

Parameters

filePath string required
options OfficeIMO.PowerPoint.PowerPointLoadOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<PowerPointDocument>
public static async Task<PowerPointDocument> LoadAsync(Stream stream, PowerPointLoadOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously loads a presentation from a caller-owned stream.

Parameters

stream System.IO.Stream required
options OfficeIMO.PowerPoint.PowerPointLoadOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<PowerPointDocument>
public void MoveSlide(int fromIndex, int toIndex) #

Moves a slide from one index to another.

Parameters

fromIndex int required
Current index of the slide.
toIndex int required
Destination index of the slide.
public Stream OpenEmbeddedPayload(string id, long maximumBytes, CancellationToken cancellationToken = default) #

Opens a complete bounded read-only detached payload stream. The caller owns its lifetime; no external target is accessed.

Parameters

id string required
maximumBytes long required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Stream
public void OpenInApplication(string? filePath = null) #

Opens the associated presentation in the operating system's registered application.

Parameters

filePath string? = null optional
public IReadOnlyList<PowerPointDeckPlanSlideRenderSummary> PreviewComposition(PowerPointDeckPlan plan, PowerPointCompositionOptions options) #

Describes how a semantic plan will resolve without changing this presentation.

Parameters

plan OfficeIMO.PowerPoint.PowerPointDeckPlan required
options OfficeIMO.PowerPoint.PowerPointCompositionOptions required
public OfficeVbaProject? ReadVbaProject(OfficeVbaReadOptions? options = null) #

Reads a detached, editable native VBA project; returns null when no project exists.

Parameters

options OfficeIMO.OfficeVbaReadOptions? = null optional

Returns

OfficeVbaProject?
public bool RemoveCustomShow(PowerPointCustomShow customShow) #

Removes a custom show and actions that target its identifier.

Parameters

customShow OfficeIMO.PowerPoint.PowerPointCustomShow required

Returns

bool
RemoveProvenance 2 overloads
public static OfficeProvenanceRemovalResult RemoveProvenance(string inputPath, string outputPath, OfficeProvenanceRemovalOptions? options = null) #

Removes selected provenance and atomically writes an Open XML presentation.

Parameters

inputPath string required
outputPath string required
options OfficeIMO.Provenance.OfficeProvenanceRemovalOptions? = null optional

Returns

OfficeProvenanceRemovalResult
public static OfficeProvenanceRemovalResult RemoveProvenance(byte[] presentationBytes, string fileName = "presentation.pptx", OfficeProvenanceRemovalOptions? options = null) #

Removes selected provenance from encoded Open XML presentation bytes.

Parameters

presentationBytes byte[] required
fileName string = "presentation.pptx" optional
options OfficeIMO.Provenance.OfficeProvenanceRemovalOptions? = null optional

Returns

OfficeProvenanceRemovalResult
RemoveSelectedContent 2 overloads
public static OfficeContentCleanupResult RemoveSelectedContent(byte[] presentationBytes, OfficeContentCleanupSelection selection, string fileName = "presentation.pptx", OfficeContentCleanupOptions? options = null) #

Removes exact selected concealed-content findings and emits the same physical PowerPoint format.

Parameters

presentationBytes byte[] required
selection OfficeIMO.ContentSafety.OfficeContentCleanupSelection required
fileName string = "presentation.pptx" optional
options OfficeIMO.ContentSafety.OfficeContentCleanupOptions? = null optional

Returns

OfficeContentCleanupResult
public static OfficeContentCleanupResult RemoveSelectedContent(string inputPath, string outputPath, OfficeContentCleanupSelection selection, OfficeContentCleanupOptions? options = null) #

Atomically writes an explicitly cleaned PowerPoint artifact.

Parameters

inputPath string required
outputPath string required
selection OfficeIMO.ContentSafety.OfficeContentCleanupSelection required
options OfficeIMO.ContentSafety.OfficeContentCleanupOptions? = null optional

Returns

OfficeContentCleanupResult
public void RemoveSlide(int index) #

Removes the slide at the specified index.

Parameters

index int required
Index of the slide to remove.
public bool RemoveVbaProject() #

Removes the embedded VBA project and its related signature or cache parts.

Returns

bool
public PowerPointCustomShow RenameCustomShow(PowerPointCustomShow customShow, string name) #

Renames a custom show while preserving its identifier and linked actions.

Parameters

customShow OfficeIMO.PowerPoint.PowerPointCustomShow required
name string required
public bool RenameSection(string name, string newName, bool ignoreCase = true) #

Renames the first section matching the provided name.

Parameters

name string required
newName string required
ignoreCase bool = true optional

Returns

bool
public int ReplaceAll(string text, string replacement, PowerPointTextSearchOptions? options = null) #

Replaces literal text on every slide.

Parameters

text string required
Text to find.
replacement string required
Replacement text; null removes each match.
options OfficeIMO.PowerPoint.PowerPointTextSearchOptions? = null optional
Comparison settings and scope. null matches ordinally, ignoring case, inside or across words, in textboxes and tables but not notes.

Returns

int The number of replaced matches.
Save 5 overloads
public void Save(Stream destination, PowerPointSaveOptions? options = null) #

Saves the native presentation to a caller-owned stream.

Parameters

destination System.IO.Stream required
options OfficeIMO.PowerPoint.PowerPointSaveOptions? = null optional
public void Save(PowerPointSaveOptions options) #

Saves pending changes to the associated destination using native output options.

Parameters

options OfficeIMO.PowerPoint.PowerPointSaveOptions required
public void Save() #

Saves all pending changes to the associated file or stream.

public void Save(string filePath) #

Saves the presentation to a file and associates that path with subsequent PowerPointDocument.Save calls.

Parameters

filePath string required
public void Save(string filePath, PowerPointSaveOptions? options) #

Saves to a file with an explicit conversion-loss policy.

Parameters

filePath string required
options OfficeIMO.PowerPoint.PowerPointSaveOptions? required
public OfficeConversionReport SaveAsImages(string folderPath, PowerPointImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Saves the selected slides without retaining their encoded payloads, and returns an aggregate report.

Parameters

folderPath string required
options OfficeIMO.PowerPoint.PowerPointImageExportOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

OfficeConversionReport
public async Task<OfficeConversionReport> SaveAsImagesAsync(string folderPath, PowerPointImageExportOptions? options = null, CancellationToken cancellationToken = default) #

Asynchronously saves the selected slides without retaining payloads, and returns an aggregate report.

Parameters

folderPath string required
options OfficeIMO.PowerPoint.PowerPointImageExportOptions? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<OfficeConversionReport>
SaveAsync 6 overloads
public Task SaveAsync(Stream destination, CancellationToken cancellationToken = default) #

Saves the native presentation asynchronously to a caller-owned stream.

Parameters

destination System.IO.Stream required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public async Task SaveAsync(Stream destination, PowerPointSaveOptions? options, CancellationToken cancellationToken = default) #

Saves the native presentation asynchronously to a caller-owned stream.

Parameters

destination System.IO.Stream required
options OfficeIMO.PowerPoint.PowerPointSaveOptions? required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public Task SaveAsync(PowerPointSaveOptions options, CancellationToken cancellationToken = default) #

Saves pending changes asynchronously to the associated destination.

Parameters

options OfficeIMO.PowerPoint.PowerPointSaveOptions required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public Task SaveAsync(CancellationToken cancellationToken = default) #

Asynchronously saves to the associated file or stream.

Parameters

cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public Task SaveAsync(string filePath, CancellationToken cancellationToken = default) #

Asynchronously saves to a file and associates it with subsequent saves.

Parameters

filePath string required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public async Task SaveAsync(string filePath, PowerPointSaveOptions? options, CancellationToken cancellationToken = default) #

Asynchronously saves to a file with an explicit conversion-loss policy.

Parameters

filePath string required
options OfficeIMO.PowerPoint.PowerPointSaveOptions? required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
SaveCopy 2 overloads
public void SaveCopy(string filePath) #

Saves an independent copy without changing the presentation's associated destination.

Parameters

filePath string required
public void SaveCopy(string filePath, PowerPointSaveOptions? options) #

Saves an independent copy with an explicit conversion-loss policy.

Parameters

filePath string required
options OfficeIMO.PowerPoint.PowerPointSaveOptions? required
SaveCopyAsync 2 overloads
public Task SaveCopyAsync(string filePath, CancellationToken cancellationToken = default) #

Asynchronously saves an independent copy without changing the presentation's associated destination.

Parameters

filePath string required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public async Task SaveCopyAsync(string filePath, PowerPointSaveOptions? options, CancellationToken cancellationToken = default) #

Asynchronously saves an independent copy with an explicit conversion-loss policy.

Parameters

filePath string required
options OfficeIMO.PowerPoint.PowerPointSaveOptions? required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public void SetGridSpacing(OfficeLength horizontal, OfficeLength vertical) #

Sets horizontal and vertical grid spacing with explicit lengths.

Parameters

horizontal OfficeIMO.OfficeLength required
vertical OfficeIMO.OfficeLength required
public void SetGuides(IEnumerable<PowerPointGuideInfo> guides) #

Sets the guide list to the provided collection.

Parameters

guides System.Collections.Generic.IEnumerable<OfficeIMO.PowerPoint.PowerPointGuideInfo> required
public void SetLayoutPlaceholderBounds(int masterIndex, int layoutIndex, PowerPointPlaceholderType placeholderType, PowerPointLayoutBox bounds, uint? index = null, bool createIfMissing = false) #

Sets layout placeholder bounds.

Parameters

masterIndex int required
layoutIndex int required
placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType required
bounds OfficeIMO.PowerPoint.PowerPointLayoutBox required
index uint? = null optional
createIfMissing bool = false optional
public void SetLayoutPlaceholderTextMargins(int masterIndex, int layoutIndex, PowerPointPlaceholderType placeholderType, OfficeLength left, OfficeLength top, OfficeLength right, OfficeLength bottom, uint? index = null, bool createIfMissing = false) #

Sets layout placeholder physical text margins.

Parameters

masterIndex int required
layoutIndex int required
placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType required
left OfficeIMO.OfficeLength required
top OfficeIMO.OfficeLength required
right OfficeIMO.OfficeLength required
bottom OfficeIMO.OfficeLength required
index uint? = null optional
createIfMissing bool = false optional
public void SetLayoutPlaceholderTextStyle(int masterIndex, int layoutIndex, PowerPointPlaceholderType placeholderType, PowerPointTextStyle style, uint? index = null, int? level = null, char? bulletChar = null, PowerPointNumberingScheme? numbering = null, bool createIfMissing = false) #

Sets layout placeholder text styling and optional bullet settings.

Parameters

masterIndex int required
layoutIndex int required
placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType required
style OfficeIMO.PowerPoint.PowerPointTextStyle required
index uint? = null optional
level int? = null optional
bulletChar char? = null optional
numbering OfficeIMO.PowerPoint.PowerPointNumberingScheme? = null optional
createIfMissing bool = false optional
public void SetThemeColor(PowerPointThemeColor color, string hexValue, int masterIndex = 0) #

Sets a theme color value in hex format (e.g. "FF0000").

Parameters

color OfficeIMO.PowerPoint.PowerPointThemeColor required
hexValue string required
masterIndex int = 0 optional
public void SetThemeColorForAllMasters(PowerPointThemeColor color, string hexValue) #

Sets a theme color value across all masters.

Parameters

color OfficeIMO.PowerPoint.PowerPointThemeColor required
hexValue string required
public void SetThemeColors(IDictionary<PowerPointThemeColor, string> colors, int masterIndex = 0) #

Sets multiple theme colors at once.

Parameters

colors System.Collections.Generic.IDictionary<OfficeIMO.PowerPoint.PowerPointThemeColor, string> required
masterIndex int = 0 optional
public void SetThemeColorsForAllMasters(IDictionary<PowerPointThemeColor, string> colors) #

Sets multiple theme colors across all masters.

Parameters

colors System.Collections.Generic.IDictionary<OfficeIMO.PowerPoint.PowerPointThemeColor, string> required
public void SetThemeFonts(PowerPointThemeFontSet fonts, int masterIndex = 0, bool keepExistingWhenNull = true) #

Sets the major/minor fonts (Latin, East Asian, and complex script).

Parameters

fonts OfficeIMO.PowerPoint.PowerPointThemeFontSet required
masterIndex int = 0 optional
keepExistingWhenNull bool = true optional
public void SetThemeFontsForAllMasters(PowerPointThemeFontSet fonts, bool keepExistingWhenNull = true) #

Sets the major/minor fonts (Latin, East Asian, and complex script) across all masters.

Parameters

fonts OfficeIMO.PowerPoint.PowerPointThemeFontSet required
keepExistingWhenNull bool = true optional
public void SetThemeLatinFonts(string majorLatin, string minorLatin, int masterIndex = 0) #

Sets the major/minor Latin fonts for the theme.

Parameters

majorLatin string required
minorLatin string required
masterIndex int = 0 optional
public void SetThemeLatinFontsForAllMasters(string majorLatin, string minorLatin) #

Sets the major/minor Latin fonts across all masters.

Parameters

majorLatin string required
minorLatin string required
public void SetThemeName(string name, int masterIndex = 0) #

Sets the name of a selected master's theme without restyling its layouts.

Parameters

name string required
Non-empty theme name.
masterIndex int = 0 optional
Zero-based master position.
public void SetThemeNameForAllMasters(string name) #

Sets the theme name across all masters.

Parameters

name string required
SetVbaProject 3 overloads
public void SetVbaProject(Stream project, long maximumBytes = 67108864) #

Adds or replaces the embedded VBA project from a complete, valid compound storage.

Parameters

project System.IO.Stream required
maximumBytes long = 67108864 optional
public void SetVbaProject(byte[] project, long maximumBytes = 67108864) #

Adds or replaces the embedded VBA project from a complete, valid compound storage.

Parameters

project byte[] required
maximumBytes long = 67108864 optional
public void SetVbaProject(OfficeVbaProject project, OfficeVbaWriteOptions? options = null) #

Applies a native source project, preserving non-signature child parts and requiring explicit signature removal.

Parameters

project OfficeIMO.OfficeVbaProject required
options OfficeIMO.OfficeVbaWriteOptions? = null optional
public static OfficePackageSigningResult SignPackage(string filePath, IOfficeSecurityProvider securityProvider, X509Certificate2 signingCertificate, OfficePackageSigningOptions? options = null) #

Creates and validates an OPC signature in a saved PPTX/PPTM package.

Parameters

filePath string required
securityProvider OfficeIMO.Security.IOfficeSecurityProvider required
signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2 required
options OfficeIMO.Security.OfficePackageSigningOptions? = null optional

Returns

OfficePackageSigningResult
public static OfficeVbaSigningResult SignVbaProject(string filePath, IOfficeSecurityProvider securityProvider, X509Certificate2 signingCertificate, OfficeVbaSigningOptions? options = null, IEnumerable<X509Certificate2>? certificateChain = null) #

Creates and atomically validates legacy, agile, and V3 VBA signatures.

Parameters

filePath string required
securityProvider OfficeIMO.Security.IOfficeSecurityProvider required
signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2 required
options OfficeIMO.Security.OfficeVbaSigningOptions? = null optional
certificateChain System.Collections.Generic.IEnumerable<System.Security.Cryptography.X509Certificates.X509Certificate2>? = null optional

Returns

OfficeVbaSigningResult
public byte[] ToBytes(PowerPointSaveOptions? options = null) #

Encodes the native presentation using one save options bag.

Parameters

options OfficeIMO.PowerPoint.PowerPointSaveOptions? = null optional

Returns

byte[]
public bool TryGetCompatibilitySourcePayload(out OfficeCompatibilitySourcePayload? payload, out string? error) #

Tries to read an original source retained by a compatibility conversion.

Parameters

payload OfficeIMO.OfficeCompatibilitySourcePayload? required
error string? required

Returns

bool
public static OfficePackageSigningResult TrySignPackage(string filePath, IOfficeSecurityProvider securityProvider, X509Certificate2 signingCertificate, OfficePackageSigningOptions? options = null) #

Attempts OPC signature creation without throwing for an ordinary signing failure.

Parameters

filePath string required
securityProvider OfficeIMO.Security.IOfficeSecurityProvider required
signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2 required
options OfficeIMO.Security.OfficePackageSigningOptions? = null optional

Returns

OfficePackageSigningResult
public static OfficeVbaSigningResult TrySignVbaProject(string filePath, IOfficeSecurityProvider securityProvider, X509Certificate2 signingCertificate, OfficeVbaSigningOptions? options = null, IEnumerable<X509Certificate2>? certificateChain = null) #

Attempts atomic VBA signing and returns structured failure evidence.

Parameters

filePath string required
securityProvider OfficeIMO.Security.IOfficeSecurityProvider required
signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2 required
options OfficeIMO.Security.OfficeVbaSigningOptions? = null optional
certificateChain System.Collections.Generic.IEnumerable<System.Security.Cryptography.X509Certificates.X509Certificate2>? = null optional

Returns

OfficeVbaSigningResult
public List<OfficeOpenXmlValidationError> ValidateDocument(OfficeOpenXmlFileFormatVersion fileFormatVersion = Microsoft365) #

Validates the presentation using the specified file format version.

Parameters

fileFormatVersion OfficeIMO.OfficeOpenXmlFileFormatVersion = Microsoft365 optional
File format version to validate against.

Returns

List<OfficeOpenXmlValidationError> List of validation errors.

Examples

using (var presentation = PowerPointDocument.Create("test.pptx")) {
    var errors = presentation.ValidateDocument();
    if (errors.Count > 0) {
        // Handle validation errors
    }
}
public static OfficePackageSignatureValidationReport ValidateSignatures(string filePath, IOfficeSecurityProvider securityProvider, OfficePackageSignatureValidationOptions? options = null) #

Validates a saved PPTX/PPTM package through an explicitly supplied security provider.

Parameters

filePath string required
securityProvider OfficeIMO.Security.IOfficeSecurityProvider required
options OfficeIMO.Security.OfficePackageSignatureValidationOptions? = null optional

Returns

OfficePackageSignatureValidationReport
public static OfficeVbaSignatureValidationResult ValidateVbaSignatures(string filePath, IOfficeSecurityProvider securityProvider, OfficeVbaSignatureInspectionOptions? options = null) #

Validates VBA CMS, trust, timestamp, and Office SIP content binding.

Parameters

filePath string required
securityProvider OfficeIMO.Security.IOfficeSecurityProvider required
options OfficeIMO.Security.OfficeVbaSignatureInspectionOptions? = null optional

Returns

OfficeVbaSignatureValidationResult

Properties

public IReadOnlyList<PowerPointCustomShow> CustomShows { get; } #

Gets the custom shows in package order.

public string? FilePath { get; } #

Gets the destination path associated with the presentation, if any.

public PresentationDocument OpenXmlDocument { get; } #

Gets the underlying Open XML package for advanced integration scenarios.

public DocumentPersistenceMode PersistenceMode { get; } #

Gets the configured persistence behavior.

public DocumentAccessMode AccessMode { get; } #

Gets whether the presentation is editable or read-only.

public IReadOnlyList<PowerPointSlide> Slides { get; } #

Collection of slides in the presentation.

public PowerPointBuiltinDocumentProperties Properties { get; } #

Built-in package properties for the presentation.

public PowerPointApplicationProperties ApplicationProperties { get; } #

Extended application properties for the presentation.

public PowerPointSlideSize SlideSize { get; } #

Slide size information for the presentation.

public OfficePackageSecurityReport? SourcePackageSecurityReport { get; private set; } #

Structural observations captured from the exact loader source bytes when requested; subsequent edits do not change this source report.

public string? SourcePackageSecurityScope { get; private set; } #

Identifies the physical source scope of captured package observations.

public PowerPointFileFormat SourceFormat { get; private set; } #

Gets the detected physical format of the presentation source.

public OfficeFormatDescriptor SourceFormatDescriptor { get; } #

Gets the concrete source format, including modern template, slideshow, add-in, and macro variants.

public string? SourcePath { get; } #

Gets the original legacy source path, or the current Open XML file association.

public IReadOnlyList<LegacyPptImportDiagnostic> LegacyPptImportDiagnostics { get; } #

Gets diagnostics produced while importing a legacy binary presentation.

public bool HasVbaProject { get; } #

Gets whether the presentation contains a VBA project.

public string ThemeName { get; set; } #

Gets or sets the name of the presentation theme.

public IReadOnlyList<PowerPointTableStyleInfo> TableStyles { get; } #

Gets the list of table styles available in the presentation.

public bool DocumentIsValid { get; } #

Indicates whether the presentation passes Open XML validation.

public List<OfficeOpenXmlValidationError> DocumentValidationErrors { get; } #

Gets the list of validation errors for the presentation.

public bool SnapToGrid { get; set; } #

Gets or sets whether slide view snapping uses the grid.

public OfficeLength GridSpacingX { get; set; } #

Horizontal grid spacing.

public OfficeLength GridSpacingY { get; set; } #

Vertical grid spacing.

public OfficeSignatureMutationPolicy SignatureMutationPolicy { get; set; } #

Signature policy applied before save. The safe default blocks mutation of signed packages.

Fields

public const long DefaultMaximumVbaProjectBytes #

Default maximum VBA project size accepted by the public mutation API.

Value: 67108864

Extension Methods

public static IEnumerable<PowerPointExtractChunk> ExtractMarkdownChunks(PowerPointDocument presentation, PowerPointExtractOptions? extract = null, PowerPointExtractChunkingOptions? chunking = null, string? sourcePath = null, CancellationToken cancellationToken = default) #

Extracts a presentation into slide-aligned chunks (one chunk per slide by default).

Parameters

presentation OfficeIMO.PowerPoint.PowerPointDocument required
extract OfficeIMO.PowerPoint.PowerPointExtractionExtensions.PowerPointExtractOptions? = null optional
chunking OfficeIMO.PowerPoint.PowerPointExtractChunkingOptions? = null optional
sourcePath string? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

IEnumerable<PowerPointExtractChunk>