tomdenton
asked on
How can I resize all the pictures in a Word 2010 document
Hi
I have a huge document with hundreds of inline images that I want to set to be the same size eg 8cm wide and the aspect remains the same - just as if I had dragged each image to size or used the Picture tools/format/width box.
The following seems to work as a pixel size but I would like to set size as cm (the default in my document) and keep the resolution the same:
Sub ResizeAllImages()
' make all inline images
' 220px wide while preserving aspect ratio
Dim oILShp As InlineShape
For Each oILShp In ActiveDocument.InlineShape s
oILShp.LockAspectRatio = msoTrue
oILShp.Width = 220
'If MsgBox("Continue?", vbYesNo) = vbNo Then Exit For
Next
End Sub
Thanks, Tom
I have a huge document with hundreds of inline images that I want to set to be the same size eg 8cm wide and the aspect remains the same - just as if I had dragged each image to size or used the Picture tools/format/width box.
The following seems to work as a pixel size but I would like to set size as cm (the default in my document) and keep the resolution the same:
Sub ResizeAllImages()
' make all inline images
' 220px wide while preserving aspect ratio
Dim oILShp As InlineShape
For Each oILShp In ActiveDocument.InlineShape
oILShp.LockAspectRatio = msoTrue
oILShp.Width = 220
'If MsgBox("Continue?", vbYesNo) = vbNo Then Exit For
Next
End Sub
Thanks, Tom
ASKER
Many thanks, should the line in the function: "If origWd 0 Then" a type?
I tried: If origWd = 0 Then but get a runtime error
I tried: If origWd > 0 Then but then all images size to 8x8
I tried: If origWd = 0 Then but get a runtime error
I tried: If origWd > 0 Then but then all images size to 8x8
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many thanks
Open in new window