Skip to main content

Show.Document

Show.Document is an object type of the Presentation module (Office.show(iframe)). 56 methods.

Generated from the SDK type definitions

Presentation · 10 object types · 586 methods · namespace Show. This reference is generated from the API document artifact (sdk-api-doc.html) produced with the SDK build. Descriptions are the editor's API comments as published. Pin the SDK and Office versions together and regenerate when either changes.

Remarks

  • Module: Presentation · Office.show(iframe) · namespace Show
  • Obtained from: app.getDocument() (root handle) on the app handle returned by Office.show(iframe). Document methods live on this handle, not on the app handle.
  • Every method returns a Promise; signatures use TypeScript notation.

Methods

MethodDescription
close()Closes the document.
createColorScheme(colorScheme)Creates a custom color theme and applies it to the current document.
deleteSlide(slideProxy)Deletes one slide.
deleteSlides(slideProxyList)Deletes multiple slides at once.
download()Downloads the document.
downloadAsPdf()Converts the document to PDF and downloads it.
duplicateSlide(slideProxy)Duplicates one slide.
duplicateSlides(slideProxyList)Duplicates multiple slides at once.
findCharts(slides, filter)Searches charts matching the criteria across multiple slides.
findComments(slides, filter)Searches comments matching the criteria across multiple slides.
findShapes(slides, filter)Searches shapes matching the criteria across multiple slides.
findSlides(filter)Searches for slides matching the criteria.
findTables(slides, filter)Searches tables matching the criteria across multiple slides.
findText(query, slideProxyList, caseSensitive)Searches text.
getChartStyleList()Returns the series color palette of each chart preset style (1-12), based on the theme applied to the current slide.
getColorScheme()Returns the color theme of the document (symmetric with setColorScheme).
getColorSchemeList()Returns the list of applicable color themes (built-in + custom).
getCurrentSlide()Returns the slide in the current view.
getDocumentInfo()Returns document (canvas) info.
getFontScheme()Returns the theme fonts of the document (symmetric with setFontScheme).
getFontSchemeList()Returns the list of applicable theme fonts (built-in + custom).
getFormatScheme()Returns the theme effects of the document (symmetric with setFormatScheme).
getFormatSchemeList()Returns the list of applicable theme effects.
getLayoutList(slideProxy)Returns the layout list of the master the given slide belongs to.
getSlide(index)Gets a slide by index.
getSlideCount()-
getSlideIndex(slideProxy)Finds a slide's 0-based index.
getSlides()Returns all slides of the document in order.
getSlideSize()Slide area size (px).
getTableStyleNames()Returns the applicable table style names.
goToSlide(slideProxy)Switches the current view to the given slide.
hideSlides(slideProxyList, isHidden)Changes the hidden state of multiple slides at once.
insertSlide(index, layoutType)Inserts a new slide.
isCommentsVisible()Returns whether comments are shown for the whole document (symmetric with showComments).
moveSlide(fromIndex, toIndex)Moves a slide to another position.
print()Prints the current document.
removeDate()Removes the date header/footer from all slides.
removeFooter()Removes the footer from all slides.
removeSlideNumber()Removes the slide number from all slides.
removeTransition(slideProxyList)Removes the transition effect from multiple slides.
replaceText(query, replacement, slideProxyList, caseSensitive)Finds the search text and replaces every match with the new text (replace all).
resetBackgrounds(slideProxyList)Resets the background of multiple slides at once.
save()Saves the document.
selectAll(scope)Selects all of the given range.
setColorScheme(colorSchemePrst)Changes the document-wide color theme.
setDate(date)Sets the date header/footer on all slides.
setFontScheme(fontSchemePrst)Changes the document's theme fonts.
setFooter(text)Sets the footer on all slides.
setFormatScheme(formatSchemePrst)Changes the theme effects of the document.
setSlideColorScheme(slideProxyList, colorSchemePrst)Applies a color theme to the given slides only.
setSlideNumber()Shows the slide number on all slides.
setTransition(slideProxyList, transition)Applies a transition effect to multiple slides at once.
setViewMode(mode)Changes the editing view's zoom/fit.
showComments(show)Sets comment visibility for the whole document.
startSlideShow(fromCurrent)Starts the slide show (full-screen presentation).
uploadImageFromUrl(url)Uploads an image (URL / data:URI) to the server file DB.

Method details

close()

Closes the document. (App-level action, so it goes through the Actor.)

close(): Promise<void>;

Returns

Promise<void>

createColorScheme(colorScheme)

Creates a custom color theme and applies it to the current document.

createColorScheme(colorScheme: ColorScheme): Promise<void>;

Parameters

NameTypeDescription
colorSchemeColorSchemeNew color scheme information

Returns

Promise<void>

deleteSlide(slideProxy)

Deletes one slide.

deleteSlide(slideProxy: Slide): Promise<void>;

Parameters

NameTypeDescription
slideProxySlideSlide to delete

Returns

Promise<void>

deleteSlides(slideProxyList)

Deletes multiple slides at once.

deleteSlides(slideProxyList: Slide[]): Promise<void>;

Parameters

NameTypeDescription
slideProxyListSlide[]Array of slides to delete

Returns

Promise<void>

download()

Downloads the document. (Server I/O, so it goes through the Actor.)

download(): Promise<void>;

Returns

Promise<void>

downloadAsPdf()

Converts the document to PDF and downloads it. Use download() for the original format (pptx, etc.). Sends the request only, without waiting for conversion - progress/failure is shown by the app's status UI. Not supported with OfficeFilter (unimplemented). (Server conversion/I/O, so it goes through the Actor.)

downloadAsPdf(): Promise<void>;

Returns

Promise<void>

duplicateSlide(slideProxy)

Duplicates one slide.

duplicateSlide(slideProxy: Slide): Promise<Slide>;

Parameters

NameTypeDescription
slideProxySlideSlide to duplicate

Returns

Promise<Slide> - The duplicated slide proxy

duplicateSlides(slideProxyList)

Duplicates multiple slides at once.

duplicateSlides(slideProxyList: Slide[]): Promise<Slide[]>;

Parameters

NameTypeDescription
slideProxyListSlide[]Array of slides to duplicate

Returns

Promise<Slide[]> - Array of duplicated slide proxies

findCharts(slides, filter)

Searches charts matching the criteria across multiple slides.

findCharts(slides: Slide[], filter?: ChartFilter): Promise<Chart[]>;

Parameters

NameTypeDescription
slidesSlide[]Slides to search
filter (optional)ChartFilterSearch criteria (same as Slide.findCharts) (default: all charts)

Returns

Promise<Chart[]> - List of matching charts

findComments(slides, filter)

Searches comments matching the criteria across multiple slides.

findComments(slides: Slide[], filter?: CommentFilter): Promise<Comment[]>;

Parameters

NameTypeDescription
slidesSlide[]Slides to search
filter (optional)CommentFilterSearch criteria (same as Slide.findComments) (default: all comments)

Returns

Promise<Comment[]> - List of matching comments

findShapes(slides, filter)

Searches shapes matching the criteria across multiple slides. Per-slide search equals Slide.findShapes; results are concatenated in slide order.

findShapes(slides: Slide[], filter?: ShapeFilter): Promise<Shape[]>;

Parameters

NameTypeDescription
slidesSlide[]Slides to search
filter (optional)ShapeFilterSearch criteria (same as Slide.findShapes) (default: all shapes)

Returns

Promise<Shape[]> - List of matching shapes

findSlides(filter)

Searches for slides matching the criteria.

findSlides(filter?: SlideFilter): Promise<Slide[]>;

Parameters

NameTypeDescription
filter (optional)SlideFilterSearch criteria (default: all slides)

Returns

Promise<Slide[]> - List of matching slides

findTables(slides, filter)

Searches tables matching the criteria across multiple slides.

findTables(slides: Slide[], filter?: TableFilter): Promise<Table[]>;

Parameters

NameTypeDescription
slidesSlide[]Slides to search
filter (optional)TableFilterSearch criteria (same as Slide.findTables) (default: all tables)

Returns

Promise<Table[]> - List of matching tables

findText(query, slideProxyList, caseSensitive)

Searches text. With slideProxyList, only those slides are searched. Matches are returned in document order (slide → shape → table cell). Merged table cells, auto-updating fields such as slide number/date, and matches crossing paragraph boundaries are not found.

findText(
query: string,
slideProxyList?: Slide[],
caseSensitive?: boolean
): Promise<{ target: (TableCell | Shape); range: { from: number; to: number }; text: string }[]>;

Parameters

NameTypeDescription
querystringText to find
slideProxyList (optional)Slide[]Slides to search (default: all slides)
caseSensitive (optional)booleanCase-sensitive (default: false)

Returns

Promise<{ target: (TableCell | Shape); range: { from: number; to: number }; text: string }[]> - List of matches. target is a TableCell for a table-cell match, otherwise a shape proxy (Shape); range can be passed straight to the formatting APIs to edit only the matched span (e.g. m.target.setBold(true, m.range)). range.from/to are character offsets (to inclusive), and text is the matched text at search time.

getChartStyleList()

Returns the series color palette of each chart preset style (1-12), based on the theme applied to the current slide. Use it to choose the style for set_chart_style. A style is a combination of a color group (4) and a background/line variant (3). The colors come from the group alone, so the same group (1-3, for example) has identical colors, and the difference inside a group (the trailing 1/2/3) is the background/line variant. The colors depend on the theme accents - they change when the theme changes.

getChartStyleList(): Promise<{ style: number; colors: string[]; variant: string }[]>;

Returns

Promise<{ style: number; colors: string[]; variant: string }[]> - chart style list; an empty array when the document has no slides

getColorScheme()

Returns the color theme of the document (symmetric with setColorScheme). It is the theme of the master the current slide belongs to and does not include per-slide overrides given with setSlideColorScheme. Use slide.getColorScheme() to read a single slide.

getColorScheme(): Promise<{ prst: string | null; name: string; colors: Record<string, unknown> } | null>;

Returns

Promise<{ prst: string | null; name: string; colors: Record<string, unknown> } | null> - color theme (prst: filled only when the theme is one listed by getColorSchemeList, null for a document-specific theme read from the file; name: theme name; colors: slot name to #RRGGBB). null when the document has no slides

getColorSchemeList()

Returns the list of applicable color themes (built-in + custom).

getColorSchemeList(): Promise<{ prst: string; name: string; colors: Record<string, unknown> }[]>;

Returns

Promise<{ prst: string; name: string; colors: Record<string, unknown> }[]> - List of color schemes (prst: preset name, name: display name, colors: slot name → #RRGGBB)

getCurrentSlide()

Returns the slide in the current view.

getCurrentSlide(): Promise<Slide>;

Returns

Promise<Slide> - current slide (null when the document has no slides)

getDocumentInfo()

Returns document (canvas) info.

getDocumentInfo(): Promise<{ width: number; height: number; slideCount: number }>;

Returns

Promise<{ width: number; height: number; slideCount: number }> - Width and height of the slide area (px) and the total slide count

getFontScheme()

Returns the theme fonts of the document (symmetric with setFontScheme).

getFontScheme(): Promise<{ prst: string | null; name: string } | null>;

Returns

Promise<{ prst: string | null; name: string } | null> - current theme fonts (prst: filled only when the theme is one listed by getFontSchemeList, null for a document-specific theme that is not in the list; name: theme name). null when the document has no slides

getFontSchemeList()

Returns the list of applicable theme fonts (built-in + custom).

getFontSchemeList(): Promise<{ prst: string; name: string }[]>;

Returns

Promise<{ prst: string; name: string }[]> - List of theme fonts (prst: preset name, name: display name)

getFormatScheme()

Returns the theme effects of the document (symmetric with setFormatScheme).

getFormatScheme(): Promise<{ prst: string | null; name: string } | null>;

Returns

Promise<{ prst: string | null; name: string } | null> - current theme effects (prst: filled only when the theme is one listed by getFormatSchemeList; name: display name, or the theme's original name when it is not in the list). null when the document has no slides

getFormatSchemeList()

Returns the list of applicable theme effects.

getFormatSchemeList(): Promise<{ prst: string; name: string }[]>;

Returns

Promise<{ prst: string; name: string }[]> - List of theme effects (prst: preset name, name: display name)

getLayoutList(slideProxy)

Returns the layout list of the master the given slide belongs to. Layouts are a master-level concept, so they are queried at the document level.

getLayoutList(slideProxy: Slide): Promise<{ name: string; type: SlideLayoutType }[]>;

Parameters

NameTypeDescription
slideProxySlideTarget slide

Returns

Promise<{ name: string; type: SlideLayoutType }[]> - layout list (an empty array when there is no target slide)

getSlide(index)

Gets a slide by index.

getSlide(index: number): Promise<Slide>;

Parameters

NameTypeDescription
indexnumber0-based

Returns

Promise<Slide> - The slide (null if out of range)

getSlideCount()

getSlideCount(): Promise<number>;

Returns

Promise<number> - Total number of slides in the document

getSlideIndex(slideProxy)

Finds a slide's 0-based index.

getSlideIndex(slideProxy: Slide): Promise<number>;

Parameters

NameTypeDescription
slideProxySlideTarget slide

Returns

Promise<number> - -1 for a slide that is not in the document

getSlides()

Returns all slides of the document in order.

getSlides(): Promise<Slide[]>;

Returns

Promise<Slide[]> - List of slides

getSlideSize()

Slide area size (px). A single value shared by every slide in the document.

getSlideSize(): Promise<{ width: number; height: number }>;

Returns

Promise<{ width: number; height: number }> - Width and height of the slide area (px)

getTableStyleNames()

Returns the applicable table style names. Pass a name from here directly to slide.insertTable / table.setStyle.

getTableStyleNames(): Promise<string[]>;

Returns

Promise<string[]> - List of table style names (same as the editor's 'Table Styles' gallery)

goToSlide(slideProxy)

Switches the current view to the given slide.

goToSlide(slideProxy: Slide): Promise<void>;

Parameters

NameTypeDescription
slideProxySlideSlide to go to

Returns

Promise<void>

hideSlides(slideProxyList, isHidden)

Changes the hidden state of multiple slides at once.

hideSlides(slideProxyList: Slide[], isHidden: boolean): Promise<void>;

Parameters

NameTypeDescription
slideProxyListSlide[]Array of target slides
isHiddenbooleantrue: hide, false: show

Returns

Promise<void>

insertSlide(index, layoutType)

Inserts a new slide.

insertSlide(index?: number, layoutType?: SlideLayoutType): Promise<Slide>;

Parameters

NameTypeDescription
index (optional)numberInsert position (0-based) (default: appended at the end)
layoutType (optional)SlideLayoutTypeLayout type. If several layouts share the type, the first one is used. If the type does not exist, BLANK is used (or the first layout of the first master when the document has no BLANK) (default: SlideLayoutType.BLANK)

Returns

Promise<Slide> - The inserted slide

isCommentsVisible()

Returns whether comments are shown for the whole document (symmetric with showComments).

isCommentsVisible(): Promise<boolean>;

Returns

Promise<boolean> - true when comments are shown

moveSlide(fromIndex, toIndex)

Moves a slide to another position.

moveSlide(fromIndex: number, toIndex: number): Promise<void>;

Parameters

NameTypeDescription
fromIndexnumberSource index (0-based)
toIndexnumberDestination index (0-based)

Returns

Promise<void>

print()

Prints the current document. (Browser print/PDF - an app-level action, so it goes through the Actor.)

print(): Promise<void>;

Returns

Promise<void>

removeDate()

Removes the date header/footer from all slides.

removeDate(): Promise<void>;

Returns

Promise<void>

removeFooter()

Removes the footer from all slides.

removeFooter(): Promise<void>;

Returns

Promise<void>

removeSlideNumber()

Removes the slide number from all slides.

removeSlideNumber(): Promise<void>;

Returns

Promise<void>

removeTransition(slideProxyList)

Removes the transition effect from multiple slides. (Handled as a single undo.)

removeTransition(slideProxyList: Slide[]): Promise<void>;

Parameters

NameTypeDescription
slideProxyListSlide[]Array of target slides

Returns

Promise<void>

replaceText(query, replacement, slideProxyList, caseSensitive)

Finds the search text and replaces every match with the new text (replace all). With slideProxyList, only those slides are changed. Merged table cells, auto-updating fields such as slide number/date, and matches crossing paragraph boundaries are not changed. Matches in text that cannot be edited (e.g., collaboration locks) are skipped and reported via skippedCount.

replaceText(
query: string,
replacement?: string,
slideProxyList?: Slide[],
caseSensitive?: boolean
): Promise<{ replacedCount: number; skippedCount: number }>;

Parameters

NameTypeDescription
querystringText to find
replacement (optional)stringReplacement text. An empty string deletes the match (default: "")
slideProxyList (optional)Slide[]Slides to replace in (default: all slides)
caseSensitive (optional)booleanCase-sensitive (default: false)

Returns

Promise<{ replacedCount: number; skippedCount: number }> - Number of matches replaced / number of matches skipped

resetBackgrounds(slideProxyList)

Resets the background of multiple slides at once.

resetBackgrounds(slideProxyList: Slide[]): Promise<void>;

Parameters

NameTypeDescription
slideProxyListSlide[]Array of target slides

Returns

Promise<void>

save()

Saves the document. (Server I/O, so it goes through the Actor.)

save(): Promise<void>;

Returns

Promise<void>

selectAll(scope)

Selects all of the given range.

selectAll(scope?: SelectScope): Promise<boolean>;

Parameters

NameTypeDescription
scope (optional)SelectScope"shape": every shape on the current slide
"slide": every slide
"text": all of the text being edited (selects nothing when not editing text) (default: SelectScope.SHAPE)

Returns

Promise<boolean> - false if there is nothing to select

setColorScheme(colorSchemePrst)

Changes the document-wide color theme. Check the list with getColorSchemeList, then pass prst.

setColorScheme(colorSchemePrst: string): Promise<void>;

Parameters

NameTypeDescription
colorSchemePrststringColor scheme preset name

Returns

Promise<void>

setDate(date)

Sets the date header/footer on all slides. (Created when absent, updated when present.)

setDate(date?: HeaderFooterDate): Promise<void>;

Parameters

NameTypeDescription
date (optional)HeaderFooterDateDate settings (default: auto-updating date)

Returns

Promise<void>

setFontScheme(fontSchemePrst)

Changes the document's theme fonts. Check the list with getFontSchemeList, then pass prst.

setFontScheme(fontSchemePrst: string): Promise<void>;

Parameters

NameTypeDescription
fontSchemePrststringTheme font preset name

Returns

Promise<void>

setFooter(text)

Sets the footer on all slides. (Created when absent, updated when present.)

setFooter(text: string): Promise<void>;

Parameters

NameTypeDescription
textstringFooter text

Returns

Promise<void>

setFormatScheme(formatSchemePrst)

Changes the theme effects of the document. Check the list with getFormatSchemeList and pass prst.

setFormatScheme(formatSchemePrst: string): Promise<void>;

Parameters

NameTypeDescription
formatSchemePrststringTheme effect preset name

Returns

Promise<void>

setSlideColorScheme(slideProxyList, colorSchemePrst)

Applies a color theme to the given slides only. Changing the whole-document theme with setColorScheme afterwards releases every per-slide override given here. Check the list with getColorSchemeList and pass prst.

setSlideColorScheme(slideProxyList: Slide[], colorSchemePrst: string): Promise<void>;

Parameters

NameTypeDescription
slideProxyListSlide[]Array of target slides
colorSchemePrststringColor scheme preset name

Returns

Promise<void>

setSlideNumber()

Shows the slide number on all slides.

setSlideNumber(): Promise<void>;

Returns

Promise<void>

setTransition(slideProxyList, transition)

Applies a transition effect to multiple slides at once. (Handled as a single undo.) Only options the effect supports are applied; values not given are filled from the default model. Remove effects with removeTransition(), not via type.

setTransition(slideProxyList: Slide[], transition: Transition): Promise<void>;

Parameters

NameTypeDescription
slideProxyListSlide[]Array of target slides (pass getSlides() to apply to all)
transitionTransitionTransition settings

Returns

Promise<void>

setViewMode(mode)

Changes the editing view's zoom/fit.

setViewMode(mode: ViewMode): Promise<void>;

Parameters

NameTypeDescription
modeViewModeView zoom or fit-to-window. Only the 8 ViewMode values are allowed.

Returns

Promise<void>

showComments(show)

Sets comment visibility for the whole document.

showComments(show: boolean): Promise<void>;

Parameters

NameTypeDescription
showbooleantrue: show comments, false: hide comments

Returns

Promise<void>

startSlideShow(fromCurrent)

Starts the slide show (full-screen presentation).

startSlideShow(fromCurrent?: boolean): Promise<void>;

Parameters

NameTypeDescription
fromCurrent (optional)booleantrue: start from the current slide, false: start from the beginning (default: false)

Returns

Promise<void>

uploadImageFromUrl(url)

Uploads an image (URL / data:URI) to the server file DB. (Image handling for SVG import.) Upload resolution is shared via ApiUtils.uploadImageLink (shared by shape/background setImageFill·htmlImport).

uploadImageFromUrl(url: string): Promise<{isError:boolean, src?:string, width?:number, height?:number}>;

Parameters

NameTypeDescription
urlstringImage URL or data URI

Returns

Promise<{isError:boolean, src?:string, width?:number, height?:number}>