Find and replace picture
Swap an existing picture, found by its alternative text or its position in the document, for a new image file, optionally resizing it and changing its alternative text.
Command in the Word toolkit · id ooa.word/find_replace_picture · 9 inputs (1 required), 1 output
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Image | File | Yes | New image file. | |
| Alt text | String | No | Replace every picture whose alternative text equals this. | |
| Index | Number | No | 1-based position of the picture in the document; used when alt_text is empty. | |
| Session | String | No | word | Session name. |
| Occurrence | String | No | all | With alt_text: replace all matching pictures, or only the first or last one in document order. |
| New alt text | String | No | New alternative text for the replaced pictures; kept when empty. | |
| Width | Number | No | New width in points; kept when empty (with only height, the width follows the new image's ratio). | |
| Height | Number | No | New height in points; kept when empty (with only width, the height follows the new image's ratio). | |
| Page | Number | No | Only look at pictures on this 1-based page of the body; index then counts the pictures on that page. |
Outputs
| Output | Type | What it is |
|---|---|---|
| count | Number | Number of pictures replaced. |