Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Resize an image with VBA?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brad Zenner - 29 Mar 2005 23:54 GMT
I'd like to create a macro to make an inserted image automatically resize to
3.5" tall, but when I record a macro the code automatically populates the
width to a specific dimension also, which could possibly distort the image.

I'm new to VBA, so I was wondering if it's possible to write code to resize
the height of an image programatically so that it will adjust the width
proportionally? I don't expect anyone to write it for me, just let me know
if that's possible. If it is, I'll make an attempt (with a guide book in
hand...) and ask the group if I get stuck.

Thanks in advance for any help/suggestions.
Jezebel - 30 Mar 2005 00:23 GMT
Get a reference to the image. Then either set the LockAspectRatio property
to true and set the height, or recalculate the width and set the height --

Width = OldWidth * NewHeight / OldHeight
Height = NewHeight

You'll need to convert the units -- width and height are in points.

> I'd like to create a macro to make an inserted image automatically resize
> to
[quoted text clipped - 10 lines]
>
> Thanks in advance for any help/suggestions.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.