Hi
I have word file with sample image
with userform1, I want to pick new image from PC, and replace it with current image, without change the current position and size
Thanks
Hi
I have word file with sample image
with userform1, I want to pick new image from PC, and replace it with current image, without change the current position and size
Thanks
The simplest way is to create a single-cell table with a fixed height and width wherever you want the image to go, then insert the image into that. The inserted image will resize, at the correct aspect ratio for the picture, to fit the space available. Replacing the image then becomes a simple matter of deleting the old one and inserting the new one into the same table. That way there's no need to mess around with VBA trying to work out horizontal/vertical positioning or height and width.
To create a single-cell table with a fixed height and width, use Insert|Table and choose one cell. Then, for the:
• rows, set the exact row height under Table Tools>Layout>Properties>Row>Specify Height>Exactly.
• columns, set the preferred column width under Table Tools>Layout>Properties>Columns,
and uncheck the 'automatically resize to fit contents' option under Table Tools>Layout>Properties>Table>Options. You might also want to set the cell margins to 0 all round. It's also a good idea to format the table paragraph with 0 before/after spacing.
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Thanks you for good idea, I try same idea with shape and its working using fill with picture, its better than table, but I still need VBA to pick the new pic and put it in fill shape picture using the userform
this is a part from my userform
Here's some code for selecting inserting an image into a table. I don't know what your shape parameters are.
Please Login or Register to view this content.
Thank you! working with table
I add your code, just change the range from table to shape "Rectangle 2"
and use change pic for the shape
Thanks!
Thank I got it
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks