andysjp
03-10-2017, 09:15 AM
Hi all
I am trying to write a macro to replace some old graphics in a Word document with new versions.
The only way I guess it's possible is for the macro to look at each picture in turn, figure out it's height and width (which will then identify which picture it is, as each picture is sized differently, luckily) and then replace it with its updated version (which is saved on my desktop as a JPG).
So for example, in my document, if there are several pictures of a raincloud which are all 1.5cm tall x 1.7cm wide, and several pictures of a sun which is 1.8cm wide x 1.8cm tall, the macro would find the first picture, see that it is 1.8cm x 1.8cm, determine that it must be a sun picture, it then needs to delete it and replace it (in the same place) with the newer version of the sun from my desktop.
I have hundreds of documents with these pictures, hence why I need a macro.
I believe the pictures are all inline shapes.
Happy for the macro to work in pixels/points rather than cm.
Please can anyone help?
Thanks in advance
Andy
I am trying to write a macro to replace some old graphics in a Word document with new versions.
The only way I guess it's possible is for the macro to look at each picture in turn, figure out it's height and width (which will then identify which picture it is, as each picture is sized differently, luckily) and then replace it with its updated version (which is saved on my desktop as a JPG).
So for example, in my document, if there are several pictures of a raincloud which are all 1.5cm tall x 1.7cm wide, and several pictures of a sun which is 1.8cm wide x 1.8cm tall, the macro would find the first picture, see that it is 1.8cm x 1.8cm, determine that it must be a sun picture, it then needs to delete it and replace it (in the same place) with the newer version of the sun from my desktop.
I have hundreds of documents with these pictures, hence why I need a macro.
I believe the pictures are all inline shapes.
Happy for the macro to work in pixels/points rather than cm.
Please can anyone help?
Thanks in advance
Andy