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.
Prerequisites
- Works on
.pptxfiles. Microsoft PowerPoint is not needed. Not supported:.ppt, PDF export, password-protected files, and showing slides as images. - Create presentation or Open gives the file a session name, such as
slides. Later steps use that name. Changes stay in an open copy until Save, Save as, or Close with Save changes. - Actions that change the deck fail on a read-only or unknown session.
- A new deck is 16:9 and has nine empty layouts but no slides: run Add slide first. The current slide starts at 1. Add slide and Copy paste slide make the new slide the current slide.
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:
- Create presentation with Session name=
slides, File path=samples/report.pptx. - Add slide with Slide layout=
BLANK. - Insert text with Text to insert=
Revenue. - Save.
- Close.
Shared fields
Slide numbers start at 1. Sizes and positions are in centimetres. All these fields are optional, except picturePath in Insert picture.
| Field | Editor field | Type; default | Use |
|---|---|---|---|
session | Session name | Stringdefault "" | 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. |
open | Open password | Credentialdefault empty Credential | Leave empty. Password-protected files are not supported, and a password that is not empty fails. |
edit | Edit password | Credentialdefault empty Credential | Like open. |
range | Range | Deckdefault FULL_ | FULL_ searches all slides in order. SLIDE_ searches only the slide slide. Choices: FULL_, SLIDE_. |
slide | Specific slide | Numberdefault 1 | Slide to search, used only with range=. It must exist. |
slide | Insert position | Slidedefault CURRENT_ | CURRENT_ uses the current slide. AT_ uses at. Inserting a shape does not change the current slide. Choices: CURRENT_, AT_. |
at | Specific slide | Numberdefault 1 | Existing slide, used only with slide. |
horizontal | Horizontal | Numberdefault 0 | Distance from the left edge of the slide. 0 puts the shape on that edge. |
vertical | Vertical | Numberdefault 0 | Distance from the top edge of the slide. 0 puts the shape on that edge. |
width | Width | Numberdefault 0 | For 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. |
height | Height | Numberdefault 0 | Like width. For tables, the total height is divided among the rows, unless a row height is set. |
picture | Picture path (Insert picture, required) or Select picture (Find and replace picture, needed when replace) | 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. |
occurrence | Picture occurrence or Text occurrence | Occurrencedefault ALL_ | ALL_ selects all matches, FIRST_ the first and LAST_ the last, in slide and paragraph order. Choices: ALL_, FIRST_, LAST_. |
match | Match case | Booleandefault false | true compares upper and lower case exactly; false ignores case. A match must be inside one paragraph. |
whole | Match whole words | Booleandefault false | true accepts a match only when the characters next to it are not letters, digits or _. false also matches inside a longer word. |
font | Font type | Stringdefault "" | Font name, such as Arial. Empty keeps the font. The font is not installed. |
font | Font type | Stringdefault "" | Like font, in Insert text. |
font | Font size | Numberdefault 0 | Size in points. 0 keeps the size. |
font | Font color | Stringdefault "" | Six hex digits, with an optional #, such as #00. Empty keeps the color. Other formats fail. |
bold | Bold | Booleandefault false | true adds the style. false keeps the text as it is (it does not remove the style). |
italic | Italic | Booleandefault false | Like bold, for italic. |
underline | Underline | Booleandefault false | Like 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
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
slide | Slide layout | Slide; BLANK | Optional. 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_, TITLE_, SECTION_, TWO_, COMPARISON, TITLE_, BLANK, CONTENT_, PICTURE_. |
position | Position | Slide; END | Optional. START inserts first, END adds last, AFTER_ inserts after the current slide, and AFTER_ inserts after after. Choices: START, END, AFTER_, AFTER_. |
after | After index | Number; 1 | Optional. Slide to insert after, used with AFTER_. A number outside the deck goes to the start or end. |
Also uses the shared fields: session.
Outputs
| Output | Type | Meaning and binding |
|---|---|---|
result | Number | Number 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.
Close (powerPointClose)
Closes the session. It can first save the changes to the original path.
Inputs
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
save | Save changes | Boolean; false | Optional. 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.
Copy paste slide (powerPointCopyPasteSlide)
Copies a slide in the same deck, with everything on it, and makes the copy current.
Inputs
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
copy | Copy slide | Copy; CURRENT_ | Optional. CURRENT_ copies the current slide. AT_ copies copy. Choices: CURRENT_, AT_. |
copy | At index | Number; 1 | Optional. Existing slide to copy, used only with copy. |
paste | Paste slide | Paste; AFTER_ | Optional. AFTER_ inserts after the current slide; AFTER_ inserts after paste. Choices: AFTER_, AFTER_. |
paste | At index | Number; 1 | Optional. Slide to paste after, used only with AFTER_. A number outside the deck goes to the start or end. |
Also uses the shared fields: session.
Outputs
| Output | Type | Meaning and binding |
|---|---|---|
result | Number | Number 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.
Create presentation (powerPointCreatePresentation)
Creates an empty 16:9 deck and opens a session that can write. It writes the file at once.
Inputs
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
file | File path | String; "" | Required. Output path ending in .pptx, such as samples/. 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
| Output | Type | Meaning and binding |
|---|---|---|
session | String | The 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.
Delete slide (powerPointDeleteSlide)
Removes one slide. Save to keep the change.
Inputs
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
slide | Slide index | Number; 1 | Optional. 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.
Find and replace picture (powerPointFindAndReplacePicture)
Counts pictures with an exact name or description, and can replace the selected ones.
Inputs
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
picture | Alt title | String; "" | 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. |
replace | Replace picture | Boolean; false | Optional. true replaces the selected pictures and needs a session that can write and an image file. false only counts. |
alt | Alt text | String; "" | Optional. Text that replaces both the name and the description of changed pictures. Empty keeps them. |
lock | Lock aspect ratio | Boolean; false | Optional. 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
| Output | Type | Meaning and binding |
|---|---|---|
result | Number | All 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.
Find and replace text (powerPointFindAndReplaceText)
Counts text matches on the selected slides, including text in tables, and can replace the selected ones.
Inputs
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
text | Find text | String; "" | Required. Exact text to find, such as cat. It must not be empty. |
replace | Replace text | Boolean; false | Optional. true replaces the selected matches and needs a session that can write. false only counts. |
text | Replace with | String; "" | Optional. Replacement text. Empty deletes the selected matches. |
Also uses the shared fields: session, matchCase, wholeWords, range, slideIndex and occurrence.
Outputs
| Output | Type | Meaning and binding |
|---|---|---|
result | Number | All 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.
Format text (powerPointFormatText)
Applies font and style to the selected matching text. The text itself does not change.
Inputs
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
text | Find text | String; "" | 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
| Output | Type | Meaning and binding |
|---|---|---|
result | Number | Number 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.
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
| Output | Type | Meaning and binding |
|---|---|---|
result | String | Name 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.
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
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
table | Table title | String; "" | Optional. Name of the new table, such as People. It must not be empty. The output repeats this exact text. |
lock | Lock aspect ratio | Boolean; false | Optional. Has no effect on tables. The editor shows it only when it is already true. |
row | Row height | Number; 0 | Optional. 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. |
column | Column width | Number; 0 | Optional. A positive column width wins over total width. Otherwise the positive total width is divided by the columns, or each column is 4 cm. |
table | Table | Table; empty Table | Required. 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. |
include | Include column header | Boolean; false | Optional. 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
| Output | Type | Meaning and binding |
|---|---|---|
result | String | The table name, the same as table. |
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.
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
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
text | Text to insert | String; "" | Required. Plain text for the new box. It must not be empty. The box does not resize to fit the text. |
format | Text formatting | Boolean; false | Optional. 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
| Output | Type | Meaning and binding |
|---|---|---|
result | String | Name of the new text box, such as Text. |
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.
Open (powerPointOpen)
Opens an existing .pptx as a named session. It does not start PowerPoint.
Inputs
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
file | File path | String; "" | Required. Path to an existing .pptx file, such as samples/. A relative path starts in the Run folder. Other extensions fail. |
open | Open in | Open; READ_ | Optional. READ_ allows changes and Save. READ_ allows search without replace, and Save as to make a copy. Choices: READ_, READ_. |
Also uses the shared fields: session, openPassword and editPassword.
Outputs
| Output | Type | Meaning and binding |
|---|---|---|
session | String | The 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.
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.
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
| Input | Editor field | Type and runtime default | Use |
|---|---|---|---|
file | File path | String; "" | Required. Output path for the .pptx copy, such as samples/. A relative path starts in the Run folder. Missing folders are created. Other extensions fail. |
overwrite | Overwrite file | Boolean; false | Optional. 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.