Select and Resize Graphics While Recording a Word Macro
Question details
The user needs to select and resize graphics while recording a Microsoft Word macro.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Recording a macro to automate the selection and resizing of images or other graphics in a Word document.
- Observed behavior
- The macro recorder does not reliably capture mouse actions used to select or resize graphics.
Open a document containing a sample graphic and identify whether it is inline with text or floating. Make the Developer tab visible through Word's ribbon settings if you plan to record or run a macro.
Use Select Objects While Recording the Macro
Try Word's Select Objects command to select a floating graphic during recording.
In Word, open Developer > Record Macro, name the macro, and select OK.
Go to Home > Select > Select Objects, then click the floating image or graphic.
Use the Picture Format or Shape Format tab to enter the desired size, then choose Developer > Stop Recording.
Open Developer > Macros, select the recorded macro, and choose Run to check whether selection and resizing were captured.

Write a VBA Macro to Resize Inline Pictures
Use a VBA macro when the recorder cannot reliably capture graphic selection or resizing.
Resize Word Documents' Pictures with WPS Writer
WPS Office is a free, lightweight Office alternative with a familiar interface. Open compatible Word documents in WPS Writer to edit text and resize pictures, making it easy to continue working across office suites. It does not fix Microsoft Word's macro recorder.

Frequently Asked Questions
Why does my Word macro skip the image I clicked?
Word's macro recorder does not reliably capture mouse-based object selection. Try Home > Select > Select Objects for a floating graphic, or write the selection and resizing logic in VBA.
Why can't Select Objects select my picture?
The picture may be set to In Line with Text. Select Objects is intended for floating objects; check the picture's layout options or use VBA designed for inline pictures.
Can I resize all inline pictures with one macro?
Yes. In Developer > Visual Basic, add a module that loops through ActiveDocument.InlineShapes and sets the Width of each picture. Set LockAspectRatio to True to preserve proportions.
How do I keep a VBA macro in my Word document?
Choose File > Save As and save the document as a Word Macro-Enabled Document (.docm). A standard DOCX file cannot store VBA macros.




