![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Microsoft Office support MS Office support forum |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Feb 2009
Posts: 3
OS: Windows XP & Vista
|
[SOLVED] Creating a macro in word to resize an image
Hi
I am trying to record a macro in Word 2003 which will resize an images width to 11cm. The trouble is, the images are all different dimensions, so I need to lock the aspect ratio for the height. Whenever I try to record a macro, it always reverts to a fixed height. Please help. PS I don't know any VB
|
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
TSF Enthusiast
Join Date: Apr 2008
Location: Australia
Posts: 562
OS: Vista
|
Re: Creating a macro in word to resize an image
Hi simjambra,
You could use a macro like: Code:
Sub ReformatPictures()
On Error Resume Next
Dim oShp As Shape
Dim iShp As InlineShape
Dim ShpScale As Double
With ActiveDocument
For Each oShp In .Shapes
With oShp
If .Type = msoPicture Or msoLinkedPicture Then
ShpScale = CentimetersToPoints(11) / .Width
.Width = .Width * ShpScale
If .LockAspectRatio = False Then .Height = .Height * ShpScale
End If
End With
Next oShp
For Each iShp In .InlineShapes
With iShp
If .Type = wdInlineShapePicture Or wdInlineShapeLinkedPicture Then
ShpScale = CentimetersToPoints(11) / .Width
.Width = .Width * ShpScale
If .LockAspectRatio = False Then .Height = .Height * ShpScale
End If
End With
Next iShp
End With
MsgBox "Finished Reformatting."
End Sub
__________________
Cheers macropod (MS MVP -Word) Last edited by macropod; 02-05-2009 at 01:47 AM. |
|
|
|
![]() |
| Thread Tools | |
|
|