Lendo Macro do Visual Basic no Word para redimensionar / centralizar / excluir todas as imagens , Como redimensionar todas as imagens no documento do Word e Como posso redimensionar uma tabela para ajustar a largura da página corrigiu um pouco a solução Kelly Tessena Keck.
Agora ele está trabalhando com qualquer largura de página disponível (não se esqueça de corrigir a altura, se necessário, também):
Sub PicturesFitPageWidth()
' ResizePic Macro
' Resizes an image
Shapes = ActiveDocument.Shapes.Count
InLines = ActiveDocument.InlineShapes.Count
'Sets the variables to loop through all shapes in the document, one for shapes and one for inline shapes.
'Calculate usable width of page
With ActiveDocument.PageSetup
WidthAvail = .PageWidth - .LeftMargin - .RightMargin
End With
For ShapeLoop = 1 To Shapes
MsgBox Prompt:="Shape " & ShapeLoop & " width: " & ActiveDocument.Shapes(ShapeLoop).Width
If ActiveDocument.Shapes(ShapeLoop).Width > WidthAvail Then
ActiveDocument.Shapes(ShapeLoop).Width = WidthAvail
End If
Next ShapeLoop
'Loops through all shapes in the document. Checks to see if they're too wide, and if they are, resizes them.
For InLineLoop = 1 To InLines
MsgBox Prompt:="Inline " & InLineLoop & " width: " & ActiveDocument.InlineShapes(InLineLoop).Width
If ActiveDocument.InlineShapes(InLineLoop).Width > WidthAvail Then
ActiveDocument.InlineShapes(InLineLoop).Width = WidthAvail
End If
Next InLineLoop
'Loops through all shapes in the document. Checks to see if they're too wide, and if they are, resizes them.
End Sub