Resizing Multiple Tables Along with all In-Line Objects/Graphics in Word

This is my workflow for resizing multiple Tables in Word, including selecting & Resizing all in-line graphics/objects/images

Step 1 – Resize All of the Graphics:

  • Select the first Graphic you want to resize
  • Go to Ribbon > Picture Tools > Format > Size and click the little icon in the bottom right corner for Advanced Options
  • On the Size Tab, go down to Scale, keeping ‘Lock Aspect Ratio’ checked, and change the percentage to the size you want. Click OK
  • Select the first few rows of your table & hit Ctrl+[  or Ctrl+] to shrink or grow the text size until it matches your new graphics size. Remember how many times you hit it to grow or shrink all text sizes, for later.
  • Be sure the size is correct, if not, go back and change the percentage until you reach the exact size you need all of them in your table
  • Remember the exact Percentage number for later.
  • Hit Alt+F11, or Go to Ribbon > Developer > Visual Basic
  • Got to Menu > Insert > Module
  • Enter the following:
    • Sub ResizeAll()
       Dim i As Long
      With ActiveDocument
          For i = 1 To .InlineShapes.Count
              With .InlineShapes(i)
                  .ScaleHeight = 75
                  .ScaleWidth = 75
              End With
          Next i
      End With
      End Sub
  • Change the ‘ScaleHeight’ & ‘ScaleWidth’ from 75 in the example to the Percentage number from the initial resizing you did.
  • Close the Macro Window
  • Hit Alt+F8, or Go to Ribbon > Developer > Macros
  • Select the Macro ‘ResizeAll’ & click ‘Run’
  • It could take a very long time, depending on many objects you are resizing, as it edits them automatically one by one, and so if you hit Ctrl+Z to undo you’ll be undoing them one by one. So if you make any mistakes just change the number in the Macro & run it again.

Step 2 – Resize All of the Tables:

  • Select the first couple of Rows of a Table
  • Go to Ribbon > Table Tools > Layout > Cell Size, and click the little icon in the bottom right corner for Advanced Options
  • On the ‘Table’ Tab, go to ‘Options…’, and change your cell margins to 0″ or whatever you want
  • Select “Automatically Resize to Fit Contents”, or not.
  • Click OK
  • On the Row Tab, Select ‘Specify Height’, and set ‘Row Height is:’ to ‘Exactly’, then type in the exact height you want, or however you need it to be.
  • Pay attention to the number and be sure it actually fits the contents, as it may show ok in word then be too small in PDF if you sized it too small
  • Repeat on the Column Tab, as desired.
  • On the ‘Cell’ Tab, go to ‘Options…’ and click ‘Cell Margins Same as Whole Table’, or as you need.
  • Choose whether or not to Wrap Text & Fit Text, or according to your needs.
  • Click Ok, and click OK again
  • Remember all of those settings you just entered, or take a note.
  • Hit Alt+F11, or Go to Ribbon > Developer > Visual Basic
  • Got to Menu > Insert > Module
  • Enter the following:
    • Sub SelectAllTables()
          Dim mytable As Table
          Application.ScreenUpdating = False
      
          For Each mytable In ActiveDocument.Tables
              mytable.Range.Editors.Add wdEditorEveryone
          Next
          ActiveDocument.SelectAllEditableRanges (wdEditorEveryone)
          ActiveDocument.DeleteAllEditableRanges (wdEditorEveryone)
          Application.ScreenUpdating = True
      End Sub
  • Wait for it to complete.
  • Go back to Ribbon > Table Tools > Layout > Cell Size, and click the little icon in the bottom right corner for Advanced Options
  • Make all of the same Selections you did earlier in your test set up.
  • Click OK on everything and wait for your adjustments to complete
  • Hit Ctrl+[  or Ctrl+] the same number of times you did earlier.
  • Save as a Macro-Free Document

**If you have individual Header Graphics that need special sizes, etc, go ahead and compete the above steps, then select the first header image, adjust the percentage size as needed, click ok, then click on the next header image and hit F4, then select the next & hit F4 etc until they’re all the done.

**You can hit Ctrl+A then Ctrl+Shift+F9 to remove all hyperlinks from text in your tables

**If your graphics or objects all have Hyperlinks, you can remove them all with the following script:

Sub RemoveAllObjectHyperlinks()
  Dim objInlinePicture As InlineShape
  Dim objPicture As Shape
 
  If ActiveDocument.InlineShapes.Count > 0 Then 
    For Each objInlinePicture In ActiveDocument.InlineShapes
      objInlinePicture.Select
 
      While Selection.Hyperlinks.Count > 0
        Selection.Hyperlinks(1).Delete
      Wend 
    Next
  End If

  If ActiveDocument.Shapes.Count > 0 Then 
    For Each objPicture In ActiveDocument.Shapes 
      objPicture.Select
 
      While Selection.Hyperlinks.Count > 0
        Selection.Hyperlinks(1).Delete
      Wend 
    Next 
  End If
End Sub

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s