PALATINELABSDocsENES

Pages

↑↓ to moveEnter to openEsc to close

PowerPoint package guide

Create and edit PPTX slides, text, tables and pictures.

Version 2.17.1. Installed versions can differ. Examples are illustrative and not tested.

Jump to actions

Packages

Prerequisites

Use test files in samples/, with samples/logo.png and samples/banner.png. Prepare $people$ as a Table with String columns name, city and rows ada, london and linus, helsinki.

To make a deck:

  1. Create presentation with Session name=slides, File path=samples/report.pptx.
  2. Add slide with Slide layout=BLANK.
  3. Insert text with Text to insert=Revenue.
  4. Save.
  5. Close.

Shared fields

Slide numbers start at 1. Sizes and positions are in centimetres. All these fields are optional, except picturePath in Insert picture.

FieldEditor fieldType; defaultUse
sessionSession nameStringdefault ""A session name that is not blank, such as slides⁠. Use the exact name from Open or Create presentation in this Run. Close it before you use the name again. It is not a credential.
openPasswordOpen passwordCredentialdefault empty CredentialLeave empty. Password-protected files are not supported, and a password that is not empty fails.
editPasswordEdit passwordCredentialdefault empty CredentialLike openPassword⁠.
rangeRangeDeckRangedefault FULL_PRESENTATIONFULL_PRESENTATION searches all slides in order. SLIDE_INDEX searches only the slide slideIndex⁠. Choices: FULL_PRESENTATION⁠, SLIDE_INDEX⁠.
slideIndexSpecific slideNumberdefault 1Slide to search, used only with range=SLIDE_INDEX⁠. It must exist.
slidePositionInsert positionSlideTargetdefault CURRENT_SLIDECURRENT_SLIDE uses the current slide. AT_SLIDE_INDEX uses atSlideIndex⁠. Inserting a shape does not change the current slide. Choices: CURRENT_SLIDE⁠, AT_SLIDE_INDEX⁠.
atSlideIndexSpecific slideNumberdefault 1Existing slide, used only with slidePosition=AT_SLIDE_INDEX⁠.
horizontalPositionHorizontalNumberdefault 0Distance from the left edge of the slide. 0 puts the shape on that edge.
verticalPositionVerticalNumberdefault 0Distance from the top edge of the slide. 0 puts the shape on that edge.
widthWidthNumberdefault 0For pictures, a positive width and height set the exact size, unless the aspect ratio is locked. If one is 0⁠, it follows the image proportions. If both are 0⁠, the picture uses its pixel size at 96 dpi. For tables, the total width is divided among the columns, unless a column width is set.
heightHeightNumberdefault 0Like width⁠. For tables, the total height is divided among the rows, unless a row height is set.
picturePathPicture path (Insert picture, required) or Select picture (Find and replace picture, needed when replacePicture=true)Stringdefault ""Path to an existing PNG, JPEG, GIF or BMP file (.png⁠, .jpg⁠, .jpeg⁠, .gif⁠, .bmp). A relative path starts in the Run folder. SVG and other formats fail.
occurrencePicture occurrence or Text occurrenceOccurrencedefault ALL_OCCURRENCESALL_OCCURRENCES selects all matches, FIRST_OCCURRENCE the first and LAST_OCCURRENCE the last, in slide and paragraph order. Choices: ALL_OCCURRENCES⁠, FIRST_OCCURRENCE⁠, LAST_OCCURRENCE⁠.
matchCaseMatch caseBooleandefault falsetrue compares upper and lower case exactly; false ignores case. A match must be inside one paragraph.
wholeWordsMatch whole wordsBooleandefault falsetrue accepts a match only when the characters next to it are not letters, digits or _⁠. false also matches inside a longer word.
fontTypeFont typeStringdefault ""Font name, such as Arial⁠. Empty keeps the font. The font is not installed.
fontNameFont typeStringdefault ""Like fontType⁠, in Insert text.
fontSizeFont sizeNumberdefault 0Size in points. 0 keeps the size.
fontColorFont colorStringdefault ""Six hex digits, with an optional #⁠, such as #00FF00⁠. Empty keeps the color. Other formats fail.
boldBoldBooleandefault falsetrue adds the style. false keeps the text as it is (it does not remove the style).
italicItalicBooleandefault falseLike bold⁠, for italic.
underlineUnderlineBooleandefault falseLike bold⁠, for underline.

Actions

Add slide (powerPointAddSlide)

Adds an empty slide with the selected layout and makes it current. The layout does not add text or picture boxes to the slide.

Inputs

InputEditor fieldType and runtime defaultUse
slideLayoutSlide layoutSlideLayoutKind⁠; BLANKOptional. Layout for the new slide. A new deck has all nine. An existing deck uses its own layout of this type, or its first layout if it has none. Choices: TITLE_SLIDE⁠, TITLE_AND_CONTENT⁠, SECTION_HEADER⁠, TWO_CONTENT⁠, COMPARISON⁠, TITLE_ONLY⁠, BLANK⁠, CONTENT_WITH_CAPTION⁠, PICTURE_WITH_CAPTION⁠.
positionPositionSlidePlacement⁠; ENDOptional. START inserts first, END adds last, AFTER_CURRENT_SLIDE inserts after the current slide, and AFTER_SLIDE_INDEX inserts after afterIndex⁠. Choices: START⁠, END⁠, AFTER_CURRENT_SLIDE⁠, AFTER_SLIDE_INDEX⁠.
afterIndexAfter indexNumber⁠; 1Optional. Slide to insert after, used with AFTER_SLIDE_INDEX⁠. A number outside the deck goes to the start or end.

Also uses the shared fields: session.

Outputs

OutputTypeMeaning and binding
resultNumberNumber of the new slide, which becomes the current slide.

Example

After Create presentation for slides, set Session name=slides, Slide layout=TITLE_SLIDE, Position=END. Bind result to a Number variable newSlide.

Expected result

result is 1 in an empty deck, and that slide is current. Adding another slide at END returns 2.

Back to actions

Close (powerPointClose)

Closes the session. It can first save the changes to the original path.

Inputs

InputEditor fieldType and runtime defaultUse
saveChangesSave changesBoolean⁠; falseOptional. true saves the open copy to the original path, then closes. false drops the changes made since the last save.

Also uses the shared fields: session.

Outputs

No output variables.

Example

After editing slides, set Session name=slides, Save changes=true.

Expected result

samples/report.pptx gets the changes and the session ends. An unknown session fails, and so does Save changes on a read-only session.

Back to actions

Copy paste slide (powerPointCopyPasteSlide)

Copies a slide in the same deck, with everything on it, and makes the copy current.

Inputs

InputEditor fieldType and runtime defaultUse
copySourceOptionCopy slideCopySource⁠; CURRENT_SLIDEOptional. CURRENT_SLIDE copies the current slide. AT_INDEX copies copySlideIndex⁠. Choices: CURRENT_SLIDE⁠, AT_INDEX⁠.
copySlideIndexAt indexNumber⁠; 1Optional. Existing slide to copy, used only with copySourceOption=AT_INDEX⁠.
pasteTargetOptionPaste slidePasteTarget⁠; AFTER_CURRENT_SLIDEOptional. AFTER_CURRENT_SLIDE inserts after the current slide; AFTER_SLIDE_INDEX inserts after pasteSlideIndex⁠. Choices: AFTER_CURRENT_SLIDE⁠, AFTER_SLIDE_INDEX⁠.
pasteSlideIndexAt indexNumber⁠; 1Optional. Slide to paste after, used only with AFTER_SLIDE_INDEX⁠. A number outside the deck goes to the start or end.

Also uses the shared fields: session.

Outputs

OutputTypeMeaning and binding
resultNumberNumber of the new slide, which becomes the current slide.

Example

Prepare slides with two slides and text Revenue on slide 1. Set Session name=slides, Copy slide=AT_INDEX, first At index (copySlideIndex)=1, Paste slide=AFTER_SLIDE_INDEX, second At index (pasteSlideIndex)=2. Bind result to copiedSlide.

Expected result

result is 3; the third slide holds Revenue and is current. The source slide stays in place. A missing source slide fails.

Back to actions

Create presentation (powerPointCreatePresentation)

Creates an empty 16:9 deck and opens a session that can write. It writes the file at once.

Inputs

InputEditor fieldType and runtime defaultUse
filePathFile pathString⁠; ""Required. Output path ending in .pptx⁠, such as samples/report.pptx⁠. A relative path starts in the Run folder. Missing folders are created, and an existing file is replaced.

Also uses the shared fields: session, openPassword and editPassword.

Outputs

OutputTypeMeaning and binding
sessionNameStringThe session name.

Example

Set Session name=slides, File path=samples/report.pptx. Leave Open password and Edit password empty. Bind sessionName to a String variable presentationSession, then run Add slide.

Expected result

sessionName is slides. The file exists at once, with no slides. A password or an extension other than .pptx fails.

Back to actions

Delete slide (powerPointDeleteSlide)

Removes one slide. Save to keep the change.

Inputs

InputEditor fieldType and runtime defaultUse
slideIndexSlide indexNumber⁠; 1Optional. Slide to remove. It must exist.

Also uses the shared fields: session.

Outputs

No output variables.

Example

Use a test slides deck with slide 1=Draft and slide 2=Final. Set Session name=slides, Slide index=1, then Save.

Expected result

Draft is removed and the old second slide becomes slide 1. If the current slide number is past the end, the last slide becomes current. A slide number that does not exist fails.

Back to actions

Find and replace picture (powerPointFindAndReplacePicture)

Counts pictures with an exact name or description, and can replace the selected ones.

Inputs

InputEditor fieldType and runtime defaultUse
pictureTitleAlt titleString⁠; ""Required. Exact picture name or description; upper and lower case must match. Use the name from Insert picture, such as Picture 2⁠, or a known alt title in an existing file.
replacePictureReplace pictureBoolean⁠; falseOptional. true replaces the selected pictures and needs a session that can write and an image file. false only counts.
altTextAlt textString⁠; ""Optional. Text that replaces both the name and the description of changed pictures. Empty keeps them.
lockRatioLock aspect ratioBoolean⁠; falseOptional. true keeps the image proportions; if both sizes are positive, width wins. false uses both sizes.

Also uses the shared fields: session, range, slideIndex, picturePath, width, height and occurrence.

Outputs

OutputTypeMeaning and binding
resultNumberAll matches, counted before Picture occurrence selects some. No match is 0⁠.

Example

First Insert picture in slides and bind its result to String pictureName. Set Session name=slides, Alt title=$pictureName$, Range=FULL_PRESENTATION, Replace picture=true, Select picture=samples/banner.png, Alt text=banner, Width=6, Height=3, Lock aspect ratio=false, Picture occurrence=ALL_OCCURRENCES. Bind result to picturesFound, then Save.

Expected result

With one inserted picture, result is 1, and the picture becomes a 6 by 3 cm banner named banner. With Replace picture on, the image file is checked even when no picture matches.

Back to actions

Find and replace text (powerPointFindAndReplaceText)

Counts text matches on the selected slides, including text in tables, and can replace the selected ones.

Inputs

InputEditor fieldType and runtime defaultUse
textToFindFind textString⁠; ""Required. Exact text to find, such as cat⁠. It must not be empty.
replaceTextReplace textBoolean⁠; falseOptional. true replaces the selected matches and needs a session that can write. false only counts.
textToReplaceReplace withString⁠; ""Optional. Replacement text. Empty deletes the selected matches.

Also uses the shared fields: session, matchCase, wholeWords, range, slideIndex and occurrence.

Outputs

OutputTypeMeaning and binding
resultNumberAll matches, counted before Text occurrence selects some. No match is 0⁠.

Example

On slide 1 of slides, insert the cat and the cattle. Set Session name=slides, Find text=cat, Match case=false, Match whole words=false, Range=SLIDE_INDEX, Specific slide=1, Replace text=true, Replace with=dog, Text occurrence=FIRST_OCCURRENCE. Bind result to matches, then Save.

Expected result

result is 2 (two matches before selection), and the text becomes the dog and the cattle. A slide that does not exist fails.

Back to actions

Format text (powerPointFormatText)

Applies font and style to the selected matching text. The text itself does not change.

Inputs

InputEditor fieldType and runtime defaultUse
textToFormatFind textString⁠; ""Required. Exact text to find and style, such as Revenue⁠. It must not be empty.

Also uses the shared fields: session, matchCase, wholeWords, range, slideIndex, occurrence, fontType, fontSize, fontColor, bold, italic and underline.

Outputs

OutputTypeMeaning and binding
resultNumberNumber of selected matches that were formatted. No match is 0⁠.

Example

Insert plain BOLD plain on a slide in slides. Set Session name=slides, Find text=BOLD, Match case=true, Range=FULL_PRESENTATION, Text occurrence=FIRST_OCCURRENCE, Font type=Arial, Font size=24, Font color=#00FF00, Bold=true. Bind result to formatted, then Save.

Expected result

result is 1; only BOLD becomes Arial 24 pt, green and bold. A color that is not six hex digits fails when a match is styled.

Back to actions

Insert picture (powerPointInsertPicture)

Adds a picture to an existing slide.

Inputs

Uses the shared fields: session, slidePosition, atSlideIndex, picturePath, horizontalPosition, verticalPosition, height and width.

Outputs

OutputTypeMeaning and binding
resultStringName of the new picture, such as Picture 2⁠. Use it in Find and replace picture.

Example

After Add slide in slides, set Session name=slides, Insert position=CURRENT_SLIDE, Picture path=samples/logo.png, Horizontal=2, Vertical=3, Width=6, Height=3. Bind result to String pictureName, then Save.

Expected result

The picture is 2 cm from the left and 3 cm from the top, and measures 6 by 3 cm. result is its name, such as Picture 2 on an empty slide. A deck with no slides, a missing file or an unsupported image format fails.

Back to actions

Insert table (powerPointInsertTable)

Writes a Table variable as a named table on a slide. Row height and column width win over the total size.

Inputs

InputEditor fieldType and runtime defaultUse
tableTitleTable titleString⁠; ""Optional. Name of the new table, such as People⁠. It must not be empty. The output repeats this exact text.
lockRatioLock aspect ratioBoolean⁠; falseOptional. Has no effect on tables. The editor shows it only when it is already true⁠.
rowHeightRow heightNumber⁠; 0Optional. A positive row height wins over total height⁠. Otherwise the positive total height is divided by the rows, or each row is 1 cm. The header row counts.
columnWidthColumn widthNumber⁠; 0Optional. A positive column width wins over total width⁠. Otherwise the positive total width is divided by the columns, or each column is 4 cm.
tableTableTable⁠; empty TableRequired. A Table variable with data, such as $people$⁠. It needs at least one column and one row. Short rows get empty cells. Values are written as text.
includeHeadersInclude column headerBoolean⁠; falseOptional. true adds the column names as a bold first row. false writes data rows only.

Also uses the shared fields: session, slidePosition, atSlideIndex, horizontalPosition, verticalPosition, height and width.

Outputs

OutputTypeMeaning and binding
resultStringThe table name, the same as tableTitle⁠.

Example

Prepare $people$ in Prerequisites. In a deck with one slide, set Session name=slides, Insert position=CURRENT_SLIDE, Table title=People, Horizontal=2, Vertical=3, Width=8, Height=3, Row height=0, Column width=0, Table=$people$, Include column header=true. Bind result to tableName, then Save.

Expected result

result is People. The table is 8 by 3 cm, with two 4 cm columns and three 1 cm rows, including the bold header. A blank title, or a table with no columns or rows, fails.

Back to actions

Insert text (powerPointInsertText)

Adds a named 16 by 2 cm text box to an existing slide. Font and style apply only when Text formatting is on.

Inputs

InputEditor fieldType and runtime defaultUse
textToInsertText to insertString⁠; ""Required. Plain text for the new box. It must not be empty. The box does not resize to fit the text.
formatOptionsGroupText formattingBoolean⁠; falseOptional. true applies the font and style fields. false ignores them and uses the default format.

Also uses the shared fields: session, slidePosition, atSlideIndex, horizontalPosition, verticalPosition, fontName, fontSize, fontColor, bold, italic and underline.

Outputs

OutputTypeMeaning and binding
resultStringName of the new text box, such as TextBox 2⁠.

Example

After Add slide in slides, set Session name=slides, Insert position=CURRENT_SLIDE, Text to insert=Revenue, Horizontal=2, Vertical=3, Text formatting=true, Font type=Arial, Font size=18, Font color=#FF5733, Bold=true. Bind result to String textBoxName, then Save.

Expected result

Revenue appears in a 16 by 2 cm text box at (2 cm, 3 cm), in Arial 18 pt bold. result is a name such as TextBox 2 on an empty slide. Empty text or a missing slide fails.

Back to actions

Open (powerPointOpen)

Opens an existing .pptx as a named session. It does not start PowerPoint.

Inputs

InputEditor fieldType and runtime defaultUse
filePathFile pathString⁠; ""Required. Path to an existing .pptx file, such as samples/report.pptx⁠. A relative path starts in the Run folder. Other extensions fail.
openModeOpen inOpenMode⁠; READ_WRITEOptional. READ_WRITE allows changes and Save. READ_ONLY allows search without replace, and Save as to make a copy. Choices: READ_WRITE⁠, READ_ONLY⁠.

Also uses the shared fields: session, openPassword and editPassword.

Outputs

OutputTypeMeaning and binding
sessionNameStringThe session name.

Example

Set Session name=slides, File path=samples/report.pptx, Open in=READ_ONLY. Leave the password fields empty and bind sessionName to presentationSession.

Expected result

sessionName is slides and the current slide is 1. Search without replace works; changes and Save fail. A missing file, another extension or a password fails.

Back to actions

Save (powerPointSave)

Saves the open copy to the original Create presentation or Open path. The session stays open.

Inputs

Uses the shared fields: session.

Outputs

No output variables.

Example

After adding a slide and text to the slides session for samples/report.pptx, set Session name=slides.

Expected result

The original file gets the current changes.

Back to actions

Save as (powerPointSaveAs)

Writes a .pptx copy to another path, also from a read-only session. A later Save still writes to the original path. It does not convert the deck.

Inputs

InputEditor fieldType and runtime defaultUse
filePathFile pathString⁠; ""Required. Output path for the .pptx copy, such as samples/report-copy.pptx⁠. A relative path starts in the Run folder. Missing folders are created. Other extensions fail.
overwriteOverwrite fileBoolean⁠; falseOptional. true replaces an existing file. With false⁠, an existing file fails.

Also uses the shared fields: session.

Outputs

No output variables.

Example

With slides open, set Session name=slides, File path=samples/report-copy.pptx, Overwrite file=false.

Expected result

A copy exists at samples/report-copy.pptx. An existing file fails when Overwrite file is false; .pdf, .ppt and other extensions fail.

Back to actions