Skip to content

Instantly share code, notes, and snippets.

@stegenfeldt
Last active July 5, 2016 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stegenfeldt/5d81ab5c57a3d20397a6b04a75b882e0 to your computer and use it in GitHub Desktop.
Save stegenfeldt/5d81ab5c57a3d20397a6b04a75b882e0 to your computer and use it in GitHub Desktop.
Word Image macro(s)
Attribute VB_Name = "ImageMacros"
Sub SetImagesTo145mmWidth()
'
' SetImagesTo145mmWidth Macro
'
'
Dim inlinePicture As InlineShape
Dim maxSize As Integer
maxSize = 145 ' In mm
' Convert mm to points
' 1 Centimeter = 28.3464567 points
maxSize = maxSize * 2.83464567
For Each inlinePicture In ActiveDocument.InlineShapes
inlinePicture.LockAspectRatio = msoTrue
inlinePicture.ScaleWidth = 100
If inlinePicture.Width > maxSize Then
inlinePicture.Width = maxSize
End If
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment