"Replace picture in Word File" changing my size of inserted picture

I am currently trying to make a automated monthly report, which uses .jpeg files from a folder, and replaces existing pictures from my Word-Template. The .jpeg files in the folder looks good, but when i use the “replace picture in Word-File” and replace the pictures, they use the same size as the existing pictures… This makes the newly added pictures in the Word-file look odd, and not the way i want. Any way to come around this problem? Then please let me know :slight_smile:

1 Like

Hi @robot.thor,
Welcome to the Community!
In fact Word is not the best tool for image-embedding. I this this can be done only by adding image from scratch instead of replacing previous image.

1 Like

Hi Pablito,
I do not understand your answer… At the moment my bot is taking a screenshot of a range in a Excel-file. This new image is to be inserted in the word file in a specific place. Over a period of the the range will get bigger and bigger, but if it does, it will not keep the correct size, when inserted. So you know, all text get greyed out, and it seems like it is zoomed in. Hope It makes sense :slight_smile:

Ok. Now I get it :slight_smile:
Hmm not sure if there is something you could do. Word is keeping dimensions quite strictly and having in mind that screenshot taken from excel can be bigger that word file the only thing I could suggest is to define other size after pasting it to the Word using attended automation. This might be tricky.

But what about instead of making screenshot you would grab copy of these excel data and paste them to the word file? As a table for example.

2 Likes

Will give it a try and reply back on this thread. It might be the solution!

1 Like

yes replacing the picture will keep the size in order to keep the document layout. I agree that is a problem when different pictures have different sizes, will bring this up for maybe an improvement in future releases.

2 Likes

@studioX Could it be an idea, to add a feature where you could choose what size the should be inserted as?
Also, why is it not possible to instead of replacing a picture, just to insert a picture after a specific header/text or something similar? :slight_smile:

1 Like

@studioX would’nt it be possible to use the script from “Insert DataTable”, where it is possible to insert relative to text, and post it after?

Echo with this issue.
Looking forward to have a feature for replace picture activity where you could choose to keep the size of inserted picture.
Also, hope it’s able to insert a picture after a specific header/text, instead of replacing a picture.

1 Like

These are all great suggestions and things we will take into account when planning our next releases. I don’t have a great answer as to “why it doesn’t currently work this way” other than to say that we haven’t had any meaningful number of requests for this functionality previously.

In terms of how to insert a picture into a specific place in the document currently, if you can get the picture copied to the clipboard (e.g. open it in a photo viewer with UI Automation and do a “Keyboard Shortcuts” to Ctrl+C, you can use the newly added “Paste Chart/Picture into Document” and that will let you insert it relative to specific text.

1 Like

How to replace image from Header in Word file? Can anyone help?