Word: Difference between revisions

From Leo's Notes
This page was last edited on 10 August 2022, at 18:11.
Created page with "== Tasks == === Resize all images === There is no easy way to resize all images in a document because you cannot select multiple images in Microsoft Word. To manually resize all images, you would have to double click on each and every image and changing the height/width manually. Alternatively, you can use the following vbscript macro. # Select the portion of the document containing your images, or hit <code>Ctrl + a</code> to select the entire document # Hit <code>A..."
 
 
Line 4: Line 4:
There is no easy way to resize all images in a document because you cannot select multiple images in Microsoft Word.  To manually resize all images, you would have to double click on each and every image and changing the height/width manually.
There is no easy way to resize all images in a document because you cannot select multiple images in Microsoft Word.  To manually resize all images, you would have to double click on each and every image and changing the height/width manually.


Alternatively, you can use the following vbscript macro.
Alternatively, you can use the following vbscript macro which I found at https://erictummers.com/2011/03/29/resize-image-in-word-with-macro/.


# Select the portion of the document containing your images, or hit <code>Ctrl + a</code> to select the entire document
# Select the portion of the document containing your images, or hit <code>Ctrl + a</code> to select the entire document
# Hit <code>Alt + F11</code>. In the VB window, insert a new module: <code>Insert -> Module</code>. Paste the following macro:
# Hit <code>Alt + F11</code>. In the VB window, insert a new module: <code>Insert -> Module</code>. Paste the following macro: {{Highlight
{{Highlight
| code = Sub ResizeImages()
| code = Sub ResizeImages()
     Dim shape As InlineShape
     Dim shape As InlineShape

Latest revision as of 18:11, 10 August 2022

Tasks

Resize all images

There is no easy way to resize all images in a document because you cannot select multiple images in Microsoft Word. To manually resize all images, you would have to double click on each and every image and changing the height/width manually.

Alternatively, you can use the following vbscript macro which I found at https://erictummers.com/2011/03/29/resize-image-in-word-with-macro/.

  1. Select the portion of the document containing your images, or hit Ctrl + a to select the entire document
  2. Hit Alt + F11. In the VB window, insert a new module: Insert -> Module. Paste the following macro:
    Sub ResizeImages()
        Dim shape As InlineShape
        For Each shape In Selection.InlineShapes
            shape.LockAspectRatio = msoTrue
            shape.Width = CentimetersToPoints(15)
        Next
    End Sub
    
  3. Hit F5 or click on the 'Run' button. The images should be resized.