logo
search
VBA & Macro Problems

How to Rotate, Resize, Crop, and Copy Images Using Word VBA Macros

Emma BrownEmma Brown Oct 10, 2026 872 views

Question details

The user needs a Word VBA script to automate the process of rotating, resizing, cropping, and copying a large scanned image across multiple printed pages.

How to Rotate, Resize, Crop, and Copy Images Using Word VBA Macros
Product
Microsoft Word
Device & OS
Mac
Scenario
Splitting a large image (such as a census record) across two different printed pages within the same document using an automated VBA macro.
Observed behavior
The native Word macro recorder fails to capture object rotation. Furthermore, manually using Excel-style VBA commands (like ShapeRange.IncrementRotation) causes a 'Method or data member not found' compile error on macOS.
Before you start

Ensure the Developer tab is enabled in your Word ribbon to access the VBA editor, and verify that your document is saved in a Macro-Enabled format (.docm).

Solution 1Recommended

Convert Inline Pictures to Floating Shapes and Apply Word VBA Properties

Because Word handles inline images and floating shapes differently, converting the image to a floating shape allows you to use VBA to control its rotation, crop parameters, and position.

The built-in macro recorder in Word struggles to accurately record manipulations on floating objects. To properly edit images via code, you must avoid Excel-specific commands like `Selection.ShapeRange.IncrementRotation` and instead use Word's native `Shape` properties.

1
Open the VBA Editor

Select the target image in your Word document and press Option + F11 (Mac) or Alt + F11 (Windows) to open the Visual Basic for Applications Editor.

2
Convert the Image to a Shape

In your macro module, write a command to convert the `InlineShape` to a floating `Shape` using the `ConvertToShape` method. This step is mandatory to unlock rotation and absolute positioning properties.

3
Apply Rotation and Sizing

Set the `Rotation`, `Width`, and `Height` properties directly on your new `Shape` object. For example, `myShape.Rotation = 90`.

4
Crop the Image

Use the `PictureFormat.Crop` property (such as `CropTop`, `CropBottom`, `CropLeft`, or `CropRight`) to adjust the visible boundaries of your scanned image.

5
Copy to the Next Page

To duplicate the manipulated image onto the following page within the same document, use `Range.InsertBreak Type:=wdPageBreak` before executing the paste command for the second half of the image.

Convert Inline Pictures to Floating Shapes and Apply Word VBA Properties
Preventing Mac Compile Errors: If you trigger a 'Method or data member not found' error on macOS, ensure you are not using `ShapeRange` relative positioning meant for Excel. Stick strictly to Word-compatible `Shape` properties like `RelativeVerticalPosition`.
Advanced Word Macro Support

Run and Edit VBA Macros Seamlessly in WPS Office

WPS Office provides excellent macro capabilities, allowing you to run, edit, and troubleshoot VBA scripts designed to manipulate images in your documents natively.

  1. 1. Install WPS Office: Download and install WPS Office, then open your macro-enabled document (.docm).
  2. 2. Access the Developer Tools: Navigate to the 'Tools' tab on the top ribbon and click on 'Developer' to reveal the macro options.
  3. 3. Open the VBA Editor: Click 'Macros' or the VBA Editor icon to paste your image manipulation script.
  4. 4. Run Your Macro: Execute the script directly within WPS Office to instantly crop, resize, and rotate your image across multiple pages.
Fully compatible with Microsoft Word .docm files and VBA scriptsBuilt-in Macro Editor for creating and debugging complex codeAdvanced, easy-to-use manual picture formatting tools right from the UILightweight, free alternative to Microsoft Office
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the Word macro recorder capture image rotation correctly?

The macro recorder in Word is limited and often ignores interactions with floating object layers like dragging or rotating. You must manually define these actions using the `Shape.Rotation` property in the VBA editor.

How do I fix the 'Method or data member not found' VBA error on Mac?

This compile error usually occurs when applying Excel-specific object commands, such as `ShapeRange.IncrementRotation`, in a Word document. Update your code to use Word-compatible properties like `Shape.Rotation`.

What is the difference between an InlineShape and a Shape in Word VBA?

An `InlineShape` sits directly in the text layer, behaving like a standard text character. A `Shape` floats above or behind the text, granting you full control over rotation, absolute positioning, and layer stacking.

Can I automate copying an image to the next page using VBA?

Yes. You can instruct your macro to insert a page break using `wdPageBreak` directly after your current layout, and then paste the copied image `Shape` object onto the newly created page.