Last active
July 5, 2016 20:05
-
-
Save stegenfeldt/5d81ab5c57a3d20397a6b04a75b882e0 to your computer and use it in GitHub Desktop.
Word Image macro(s)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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