karimjohnson
asked on
insert an image in front of text in a table using word vba
I have a word document with a table in it. in one of the cells I want to insert an image. The image needs to stay put in that cell (if I add rows above it, for example) but also needs to be able to be in front of text. I would like to be able to adjust the placement relative to its insertion point, using vba. I am stumped on how to achieve all (or at least most) of this.
ASKER
Is there a way to:
1. Allow the image to overlap the rows above and below (the image should typically be larger than the cell height, but I don't want the cell height to expand)
2. set the cell location dynamically? (for example, I have been trying to use a bookmark within the cell, so that whatever row the cell ends up on, I have an easy way to find it)
1. Allow the image to overlap the rows above and below (the image should typically be larger than the cell height, but I don't want the cell height to expand)
2. set the cell location dynamically? (for example, I have been trying to use a bookmark within the cell, so that whatever row the cell ends up on, I have an easy way to find it)
ASKER
playing around a bit with it I am able to set the range to the range of a bookmark (which is set to a cell). However, I still have the problem that the image expands the cell height rather than overlaps the adjacent cell(s). I can fix this by manually going into format/picture and setting to in front of text, but I need this to be automated somehow.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It seems to work fine if I use your code, then follow a series of manual steps (select format->picture, select Layout Tab, select In Front of Text, press Ok. then move the image as desired with arrow keys or mouse. Are you saying that you don't know how to automate that? Or that it cannot be automated?
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
Open in new window