PowerPointDocument
OfficeIMO.PowerPoint
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.
Returned or exposed by 5
- Method PowerPointDeckDesign.ApplyTo
- Method PowerPointDocument.Create
- Method PowerPointDocument.Load
- Method PowerPointDocument.LoadAsync
- Method PowerPointTemplate.CreateDocument
Accepted by parameters 7
- Method PowerPointDeckDesign.ApplyTo
- Extension method PowerPointDocument.ExtractMarkdownChunks
- Method PowerPointDocument.ImportSlide
- Method PowerPointDocument.ImportSlides
- Method PowerPointExtractionExtensions.ExtractMarkdownChunks
- Method PowerPointTemplate.Inspect
- Method PowerPointTemplateInventory.ApplyBrandTo
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
- author OfficeIMO.PowerPoint.PowerPointCommentAuthor
- text string
- x OfficeIMO.OfficeLength = default
- y OfficeIMO.OfficeLength = default
- created System.DateTime? = null
Returns
PowerPointClassicCommentpublic 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
- margin OfficeIMO.OfficeLength
- gutter OfficeIMO.OfficeLength
- includeOuterEdges bool = true
- clearExisting bool = false
Returns
IReadOnlyList<PowerPointGuideInfo>public PowerPointCustomShow AddCustomShow(string name, IEnumerable<PowerPointSlide> slides) #Creates a custom show with an explicit, nonempty slide sequence.
Parameters
- name string
- slides System.Collections.Generic.IEnumerable<OfficeIMO.PowerPoint.PowerPointSlide>
Returns
PowerPointCustomShowpublic PowerPointGuideInfo AddGuide(PowerPointGuideOrientation orientation, OfficeLength position) #Adds a guide to slide view.
Parameters
- orientation OfficeIMO.PowerPoint.PowerPointGuideOrientation
- position OfficeIMO.OfficeLength
Returns
PowerPointGuideInfopublic 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
- author OfficeIMO.PowerPoint.PowerPointCommentAuthor
- text string
- status OfficeIMO.PowerPoint.PowerPointModernCommentStatus = Active
- x OfficeIMO.OfficeLength = default
- y OfficeIMO.OfficeLength = default
- created System.DateTime? = null
Returns
PowerPointModernCommentpublic 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
- margin OfficeIMO.OfficeLength
- gutter OfficeIMO.OfficeLength
- includeOuterEdges bool = true
- clearExisting bool = false
Returns
IReadOnlyList<PowerPointGuideInfo>public PowerPointSectionInfo AddSection(string name, int startSlideIndex) #Adds a new section starting at the specified slide index.
Parameters
- name string
- startSlideIndex int
Returns
PowerPointSectionInfopublic PowerPointSlide AddSlide(PowerPointSlideLayoutType layoutType, int masterIndex = 0) #Adds a slide using a layout type.
Parameters
- layoutType OfficeIMO.PowerPoint.PowerPointSlideLayoutType
- masterIndex int = 0
Returns
PowerPointSlidepublic PowerPointSlide AddSlide(string layoutName, int masterIndex = 0, bool ignoreCase = true) #Adds a slide using a layout name.
Parameters
- layoutName string
- masterIndex int = 0
- ignoreCase bool = true
Returns
PowerPointSlidepublic PowerPointSlide AddSlide(int masterIndex = 0, int layoutIndex = 0) #Adds a new slide using the specified master and layout indexes.
Parameters
- masterIndex int = 0
- Index of the slide master.
- layoutIndex int = 0
- Index of the slide layout.
Returns
PowerPointSlidepublic PowerPointSlide AddSlide(PowerPointTemplateLayoutInfo layout) #Adds a slide using a layout selected from a template inventory.
Parameters
- layout OfficeIMO.PowerPoint.PowerPointTemplateLayoutInfo
Returns
PowerPointSlidepublic 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
- The number of slides to add.
- masterIndex int = 0
- Index of the slide master.
- layoutIndex int = 0
- Index of the slide layout.
- cancellationToken System.Threading.CancellationToken = default
- 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?>
- columns System.Collections.Generic.IEnumerable<OfficeIMO.PowerPoint.PowerPointTableColumn<T?>>
- options OfficeIMO.PowerPoint.PowerPointTablePaginationOptions? = null
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
- Theme to apply. Explicit shape formatting is retained.
- masterIndex int? = null
- Zero-based master to restyle, or null for every master and the presentation defaults.
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
- Semantic slide intent to render.
- options OfficeIMO.PowerPoint.PowerPointCompositionOptions
- Design, continuation, template-layout, validation, and preflight policy.
Returns
PowerPointCompositionResult The resolved plan, design, rendered slides, and preflight report.public static PowerPointDocument Create(PowerPointCreateOptions? options = null) #Creates a detached presentation with explicit persistence.
Parameters
- options OfficeIMO.PowerPoint.PowerPointCreateOptions? = null
Returns
PowerPointDocumentpublic 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
- options OfficeIMO.PowerPoint.PowerPointCreateOptions? = null
Returns
PowerPointDocumentpublic 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
- options OfficeIMO.PowerPoint.PowerPointCreateOptions? = null
Returns
PowerPointDocumentpublic 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
ValueTaskpublic PowerPointSlide DuplicateSlide(int index, int? insertAt = null) #Duplicates a slide and inserts it into the presentation.
Parameters
- index int
- Index of the slide to duplicate.
- insertAt int? = null
- Index where the duplicate should be inserted. Defaults to index + 1.
Returns
PowerPointSlidepublic 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
- layoutIndex int = 0
- text string? = null
- bounds OfficeIMO.PowerPoint.PowerPointLayoutBox? = null
- index uint? = null
Returns
PowerPointTextBoxpublic 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
- layoutIndex int
- placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType
- index uint? = null
- bounds OfficeIMO.PowerPoint.PowerPointLayoutBox? = null
- name string? = null
Returns
PowerPointTextBoxpublic 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
- layoutIndex int = 0
- text string? = null
- bounds OfficeIMO.PowerPoint.PowerPointLayoutBox? = null
- index uint? = null
Returns
PowerPointTextBoxpublic IReadOnlyList<OfficeImageExportResult> ExportImages(OfficeImageExportFormat format, PowerPointImageExportOptions? options = null) #Exports presentation slides as supported raster formats or SVG images.
Parameters
- format OfficeIMO.Drawing.OfficeImageExportFormat
- options OfficeIMO.PowerPoint.PowerPointImageExportOptions? = null
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
- consumer OfficeIMO.Drawing.OfficeImageExportConsumer
- options OfficeIMO.PowerPoint.PowerPointImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
public void ExportSlide(int slideIndex, string filePath) #Exports a single slide as a standalone one-slide PowerPoint presentation.
Parameters
- slideIndex int
- Zero-based index of the slide to export.
- filePath string
- Destination .pptx path.
public void ExportSlide(int slideIndex, Stream destination) #Exports a single slide as a standalone one-slide PowerPoint presentation.
Parameters
- slideIndex int
- Zero-based index of the slide to export.
- destination System.IO.Stream
- Writable destination stream.
public IReadOnlyList<PowerPointClassicComment> GetClassicComments(PowerPointSlide slide) #Returns editable classic comments for a slide.
Parameters
- slide OfficeIMO.PowerPoint.PowerPointSlide
Returns
IReadOnlyList<PowerPointClassicComment>public PowerPointCustomShow? GetCustomShow(string name) #Finds a custom show by name using ordinal, case-insensitive matching.
Parameters
- name string
Returns
PowerPointCustomShow?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
- cancellationToken System.Threading.CancellationToken = default
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
Returns
IReadOnlyList<OfficeEmbeddedPayloadInfo>public IReadOnlyList<PowerPointGuideInfo> GetGuides() #Returns the current guides defined for slide view.
Returns
IReadOnlyList<PowerPointGuideInfo>public int GetLayoutIndex(PowerPointSlideLayoutType layoutType, int masterIndex = 0) #Finds a layout index by layout type.
Parameters
- layoutType OfficeIMO.PowerPoint.PowerPointSlideLayoutType
- masterIndex int = 0
Returns
intpublic int GetLayoutIndex(string layoutName, int masterIndex = 0, bool ignoreCase = true) #Finds a layout index by layout name.
Parameters
- layoutName string
- masterIndex int = 0
- ignoreCase bool = true
Returns
intpublic PowerPointTextBox? GetLayoutPlaceholderTextBox(int masterIndex, int layoutIndex, PowerPointPlaceholderType placeholderType, uint? index = null) #Retrieves a layout placeholder textbox for a master/layout pair.
Parameters
- masterIndex int
- layoutIndex int
- placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType
- index uint? = null
Returns
PowerPointTextBox?public IReadOnlyList<PowerPointModernComment> GetModernComments(PowerPointSlide slide) #Returns editable modern comments for a slide.
Parameters
- slide OfficeIMO.PowerPoint.PowerPointSlide
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
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
- Zero-based master position.
Returns
OfficeThemepublic string? GetThemeColor(PowerPointThemeColor color, int masterIndex = 0) #Gets a theme color value in hex format (e.g. "FF0000").
Parameters
- color OfficeIMO.PowerPoint.PowerPointThemeColor
- masterIndex int = 0
Returns
string?public IReadOnlyDictionary<PowerPointThemeColor, string> GetThemeColors(int masterIndex = 0) #Returns the theme colors that are defined on the master.
Parameters
- masterIndex int = 0
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
Returns
PowerPointThemeFontSetpublic PowerPointThemeFontInfo GetThemeLatinFonts(int masterIndex = 0) #Gets the major/minor Latin fonts for the theme.
Parameters
- masterIndex int = 0
Returns
PowerPointThemeFontInfopublic byte[]? GetVbaProjectBytes(long maximumBytes = 67108864) #Reads the exact embedded VBA compound storage without changing the caller-visible package.
Parameters
- maximumBytes long = 67108864
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
- Presentation to import from.
- sourceIndex int
- Index of the slide to import.
- insertAt int? = null
- Index where the imported slide should be inserted. Defaults to end.
Returns
PowerPointSlidepublic 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
- The source document, which may also be this document.
- sourceIndices System.Collections.Generic.IEnumerable<int>
- Zero-based source positions, in the requested order. Repeated positions are imported once.
- insertAt int? = null
- 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
Returns
PowerPointInspectionReportpublic PowerPointAccessibilityReport InspectAccessibility(PowerPointAccessibilityOptions? options = null) #Inspects generated or imported slides against a structured accessibility policy.
Parameters
- options OfficeIMO.PowerPoint.PowerPointAccessibilityOptions? = null
public PowerPointAnimationReport InspectAnimations() #Inspects slide timing trees before any animation authoring is attempted.
Returns
PowerPointAnimationReportpublic PowerPointAnimationReport InspectAnimations(PowerPointAnimationInspectionOptions options) #Inspects slide timing trees with explicit traversal and result limits.
Parameters
- options OfficeIMO.PowerPoint.PowerPointAnimationInspectionOptions
Returns
PowerPointAnimationReportpublic 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
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeEmbeddedPayloadInspectionpublic PowerPointFeatureReport InspectFeatures() #Inspects presentation features and reports which ones OfficeIMO can edit, partially edit, preserve, or does not support yet.
Returns
PowerPointFeatureReportpublic 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
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeContentSafetyReportpublic 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
public PowerPointReviewReport InspectReviewComments() #Inspects classic and modern comments without mutating review markup.
Returns
PowerPointReviewReportpublic PowerPointReviewReport InspectReviewComments(CancellationToken cancellationToken) #Inspects native comment threads with cancellation between slides, comments and replies.
Parameters
- cancellationToken System.Threading.CancellationToken
Returns
PowerPointReviewReportpublic PowerPointSignatureReport InspectSignatures() #Inspects package signature metadata without mutating it.
Returns
PowerPointSignatureReportpublic 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
- maxBytes long = 67108864
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"
Returns
PowerPointVisualProofReportpublic static PowerPointDocument Load(string filePath, PowerPointLoadOptions? options = null) #Loads an existing presentation into detached memory.
Parameters
- filePath string
- options OfficeIMO.PowerPoint.PowerPointLoadOptions? = null
Returns
PowerPointDocumentpublic static PowerPointDocument Load(string filePath, PowerPointLoadOptions? options, CancellationToken cancellationToken) #Loads an existing presentation into detached memory with cancellation.
Parameters
- filePath string
- options OfficeIMO.PowerPoint.PowerPointLoadOptions?
- cancellationToken System.Threading.CancellationToken
Returns
PowerPointDocumentpublic 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
- options OfficeIMO.PowerPoint.PowerPointLoadOptions? = null
Returns
PowerPointDocumentpublic 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
- options OfficeIMO.PowerPoint.PowerPointLoadOptions?
- cancellationToken System.Threading.CancellationToken
Returns
PowerPointDocumentpublic static PowerPointDocument Load(string path, PowerPointLoadOptions? options, out OfficeConversionReport report) #Loads a presentation and returns findings from its source projection.
Parameters
- path string
- options OfficeIMO.PowerPoint.PowerPointLoadOptions?
- report OfficeIMO.OfficeConversionReport
Returns
PowerPointDocumentpublic 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
- options OfficeIMO.PowerPoint.PowerPointLoadOptions?
- report OfficeIMO.OfficeConversionReport
Returns
PowerPointDocumentpublic static async Task<PowerPointDocument> LoadAsync(string filePath, PowerPointLoadOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an existing presentation into detached memory.
Parameters
- filePath string
- options OfficeIMO.PowerPoint.PowerPointLoadOptions? = null
- cancellationToken System.Threading.CancellationToken = default
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
- options OfficeIMO.PowerPoint.PowerPointLoadOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<PowerPointDocument>public void MoveSlide(int fromIndex, int toIndex) #Moves a slide from one index to another.
Parameters
- fromIndex int
- Current index of the slide.
- toIndex int
- 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
- maximumBytes long
- cancellationToken System.Threading.CancellationToken = default
Returns
Streampublic void OpenInApplication(string? filePath = null) #Opens the associated presentation in the operating system's registered application.
Parameters
- filePath string? = null
public IReadOnlyList<PowerPointDeckPlanSlideRenderSummary> PreviewComposition(PowerPointDeckPlan plan, PowerPointCompositionOptions options) #Describes how a semantic plan will resolve without changing this presentation.
Parameters
- plan OfficeIMO.PowerPoint.PowerPointDeckPlan
- options OfficeIMO.PowerPoint.PowerPointCompositionOptions
Returns
IReadOnlyList<PowerPointDeckPlanSlideRenderSummary>public OfficeVbaProject? ReadVbaProject(OfficeVbaReadOptions? options = null) #Reads a detached, editable native VBA project; returns null when no project exists.
Parameters
- options OfficeIMO.OfficeVbaReadOptions? = null
Returns
OfficeVbaProject?public bool RemoveCustomShow(PowerPointCustomShow customShow) #Removes a custom show and actions that target its identifier.
Parameters
- customShow OfficeIMO.PowerPoint.PowerPointCustomShow
Returns
boolpublic static OfficeProvenanceRemovalResult RemoveProvenance(string inputPath, string outputPath, OfficeProvenanceRemovalOptions? options = null) #Removes selected provenance and atomically writes an Open XML presentation.
Parameters
- inputPath string
- outputPath string
- options OfficeIMO.Provenance.OfficeProvenanceRemovalOptions? = null
Returns
OfficeProvenanceRemovalResultpublic static OfficeProvenanceRemovalResult RemoveProvenance(byte[] presentationBytes, string fileName = "presentation.pptx", OfficeProvenanceRemovalOptions? options = null) #Removes selected provenance from encoded Open XML presentation bytes.
Parameters
- presentationBytes byte[]
- fileName string = "presentation.pptx"
- options OfficeIMO.Provenance.OfficeProvenanceRemovalOptions? = null
Returns
OfficeProvenanceRemovalResultpublic 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[]
- selection OfficeIMO.ContentSafety.OfficeContentCleanupSelection
- fileName string = "presentation.pptx"
- options OfficeIMO.ContentSafety.OfficeContentCleanupOptions? = null
Returns
OfficeContentCleanupResultpublic static OfficeContentCleanupResult RemoveSelectedContent(string inputPath, string outputPath, OfficeContentCleanupSelection selection, OfficeContentCleanupOptions? options = null) #Atomically writes an explicitly cleaned PowerPoint artifact.
Parameters
- inputPath string
- outputPath string
- selection OfficeIMO.ContentSafety.OfficeContentCleanupSelection
- options OfficeIMO.ContentSafety.OfficeContentCleanupOptions? = null
Returns
OfficeContentCleanupResultpublic void RemoveSlide(int index) #Removes the slide at the specified index.
Parameters
- index int
- Index of the slide to remove.
public bool RemoveVbaProject() #Removes the embedded VBA project and its related signature or cache parts.
Returns
boolpublic PowerPointCustomShow RenameCustomShow(PowerPointCustomShow customShow, string name) #Renames a custom show while preserving its identifier and linked actions.
Parameters
- customShow OfficeIMO.PowerPoint.PowerPointCustomShow
- name string
Returns
PowerPointCustomShowpublic bool RenameSection(string name, string newName, bool ignoreCase = true) #Renames the first section matching the provided name.
Parameters
- name string
- newName string
- ignoreCase bool = true
Returns
boolpublic int ReplaceAll(string text, string replacement, PowerPointTextSearchOptions? options = null) #Replaces literal text on every slide.
Parameters
- text string
- Text to find.
- replacement string
- Replacement text; null removes each match.
- options OfficeIMO.PowerPoint.PowerPointTextSearchOptions? = null
- 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.public void Save(Stream destination, PowerPointSaveOptions? options = null) #Saves the native presentation to a caller-owned stream.
Parameters
- destination System.IO.Stream
- options OfficeIMO.PowerPoint.PowerPointSaveOptions? = null
public void Save(PowerPointSaveOptions options) #Saves pending changes to the associated destination using native output options.
Parameters
- options OfficeIMO.PowerPoint.PowerPointSaveOptions
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
public void Save(string filePath, PowerPointSaveOptions? options) #Saves to a file with an explicit conversion-loss policy.
Parameters
- filePath string
- options OfficeIMO.PowerPoint.PowerPointSaveOptions?
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
- options OfficeIMO.PowerPoint.PowerPointImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeConversionReportpublic 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
- options OfficeIMO.PowerPoint.PowerPointImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<OfficeConversionReport>public Task SaveAsync(Stream destination, CancellationToken cancellationToken = default) #Saves the native presentation asynchronously to a caller-owned stream.
Parameters
- destination System.IO.Stream
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic 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
- options OfficeIMO.PowerPoint.PowerPointSaveOptions?
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic Task SaveAsync(PowerPointSaveOptions options, CancellationToken cancellationToken = default) #Saves pending changes asynchronously to the associated destination.
Parameters
- options OfficeIMO.PowerPoint.PowerPointSaveOptions
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic Task SaveAsync(CancellationToken cancellationToken = default) #Asynchronously saves to the associated file or stream.
Parameters
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic Task SaveAsync(string filePath, CancellationToken cancellationToken = default) #Asynchronously saves to a file and associates it with subsequent saves.
Parameters
- filePath string
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic async Task SaveAsync(string filePath, PowerPointSaveOptions? options, CancellationToken cancellationToken = default) #Asynchronously saves to a file with an explicit conversion-loss policy.
Parameters
- filePath string
- options OfficeIMO.PowerPoint.PowerPointSaveOptions?
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic void SaveCopy(string filePath) #Saves an independent copy without changing the presentation's associated destination.
Parameters
- filePath string
public void SaveCopy(string filePath, PowerPointSaveOptions? options) #Saves an independent copy with an explicit conversion-loss policy.
Parameters
- filePath string
- options OfficeIMO.PowerPoint.PowerPointSaveOptions?
public Task SaveCopyAsync(string filePath, CancellationToken cancellationToken = default) #Asynchronously saves an independent copy without changing the presentation's associated destination.
Parameters
- filePath string
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic async Task SaveCopyAsync(string filePath, PowerPointSaveOptions? options, CancellationToken cancellationToken = default) #Asynchronously saves an independent copy with an explicit conversion-loss policy.
Parameters
- filePath string
- options OfficeIMO.PowerPoint.PowerPointSaveOptions?
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic void SetGridSpacing(OfficeLength horizontal, OfficeLength vertical) #Sets horizontal and vertical grid spacing with explicit lengths.
Parameters
- horizontal OfficeIMO.OfficeLength
- vertical OfficeIMO.OfficeLength
public void SetGuides(IEnumerable<PowerPointGuideInfo> guides) #Sets the guide list to the provided collection.
Parameters
- guides System.Collections.Generic.IEnumerable<OfficeIMO.PowerPoint.PowerPointGuideInfo>
public void SetLayoutPlaceholderBounds(int masterIndex, int layoutIndex, PowerPointPlaceholderType placeholderType, PowerPointLayoutBox bounds, uint? index = null, bool createIfMissing = false) #Sets layout placeholder bounds.
Parameters
- masterIndex int
- layoutIndex int
- placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType
- bounds OfficeIMO.PowerPoint.PowerPointLayoutBox
- index uint? = null
- createIfMissing bool = false
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
- layoutIndex int
- placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType
- left OfficeIMO.OfficeLength
- top OfficeIMO.OfficeLength
- right OfficeIMO.OfficeLength
- bottom OfficeIMO.OfficeLength
- index uint? = null
- createIfMissing bool = false
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
- layoutIndex int
- placeholderType OfficeIMO.PowerPoint.PowerPointPlaceholderType
- style OfficeIMO.PowerPoint.PowerPointTextStyle
- index uint? = null
- level int? = null
- bulletChar char? = null
- numbering OfficeIMO.PowerPoint.PowerPointNumberingScheme? = null
- createIfMissing bool = false
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
- hexValue string
- masterIndex int = 0
public void SetThemeColorForAllMasters(PowerPointThemeColor color, string hexValue) #Sets a theme color value across all masters.
Parameters
- color OfficeIMO.PowerPoint.PowerPointThemeColor
- hexValue string
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>
- masterIndex int = 0
public void SetThemeColorsForAllMasters(IDictionary<PowerPointThemeColor, string> colors) #Sets multiple theme colors across all masters.
Parameters
- colors System.Collections.Generic.IDictionary<OfficeIMO.PowerPoint.PowerPointThemeColor, string>
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
- masterIndex int = 0
- keepExistingWhenNull bool = true
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
- keepExistingWhenNull bool = true
public void SetThemeLatinFonts(string majorLatin, string minorLatin, int masterIndex = 0) #Sets the major/minor Latin fonts for the theme.
Parameters
- majorLatin string
- minorLatin string
- masterIndex int = 0
public void SetThemeLatinFontsForAllMasters(string majorLatin, string minorLatin) #Sets the major/minor Latin fonts across all masters.
Parameters
- majorLatin string
- minorLatin string
public void SetThemeName(string name, int masterIndex = 0) #Sets the name of a selected master's theme without restyling its layouts.
Parameters
- name string
- Non-empty theme name.
- masterIndex int = 0
- Zero-based master position.
public void SetThemeNameForAllMasters(string name) #Sets the theme name across all masters.
Parameters
- name string
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
- maximumBytes long = 67108864
public void SetVbaProject(byte[] project, long maximumBytes = 67108864) #Adds or replaces the embedded VBA project from a complete, valid compound storage.
Parameters
- project byte[]
- maximumBytes long = 67108864
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
- options OfficeIMO.OfficeVbaWriteOptions? = null
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
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
- options OfficeIMO.Security.OfficePackageSigningOptions? = null
Returns
OfficePackageSigningResultpublic 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
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
- options OfficeIMO.Security.OfficeVbaSigningOptions? = null
- certificateChain System.Collections.Generic.IEnumerable<System.Security.Cryptography.X509Certificates.X509Certificate2>? = null
Returns
OfficeVbaSigningResultpublic byte[] ToBytes(PowerPointSaveOptions? options = null) #Encodes the native presentation using one save options bag.
Parameters
- options OfficeIMO.PowerPoint.PowerPointSaveOptions? = null
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?
- error string?
Returns
boolpublic 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
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
- options OfficeIMO.Security.OfficePackageSigningOptions? = null
Returns
OfficePackageSigningResultpublic 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
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
- options OfficeIMO.Security.OfficeVbaSigningOptions? = null
- certificateChain System.Collections.Generic.IEnumerable<System.Security.Cryptography.X509Certificates.X509Certificate2>? = null
Returns
OfficeVbaSigningResultpublic List<OfficeOpenXmlValidationError> ValidateDocument(OfficeOpenXmlFileFormatVersion fileFormatVersion = Microsoft365) #Validates the presentation using the specified file format version.
Parameters
- fileFormatVersion OfficeIMO.OfficeOpenXmlFileFormatVersion = Microsoft365
- 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
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- options OfficeIMO.Security.OfficePackageSignatureValidationOptions? = null
Returns
OfficePackageSignatureValidationReportpublic static OfficeVbaSignatureValidationResult ValidateVbaSignatures(string filePath, IOfficeSecurityProvider securityProvider, OfficeVbaSignatureInspectionOptions? options = null) #Validates VBA CMS, trust, timestamp, and Office SIP content binding.
Parameters
- filePath string
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- options OfficeIMO.Security.OfficeVbaSignatureInspectionOptions? = null
Returns
OfficeVbaSignatureValidationResultInherited Methods
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 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.
67108864Extension 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
- extract OfficeIMO.PowerPoint.PowerPointExtractionExtensions.PowerPointExtractOptions? = null
- chunking OfficeIMO.PowerPoint.PowerPointExtractChunkingOptions? = null
- sourcePath string? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IEnumerable<PowerPointExtractChunk>