How to Rotate, Resize, Crop, and Copy Images Using Word VBA Macros
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.

- 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.
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).
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.
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.
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.
Set the `Rotation`, `Width`, and `Height` properties directly on your new `Shape` object. For example, `myShape.Rotation = 90`.
Use the `PictureFormat.Crop` property (such as `CropTop`, `CropBottom`, `CropLeft`, or `CropRight`) to adjust the visible boundaries of your scanned image.
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.

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. Install WPS Office: Download and install WPS Office, then open your macro-enabled document (.docm).
- 2. Access the Developer Tools: Navigate to the 'Tools' tab on the top ribbon and click on 'Developer' to reveal the macro options.
- 3. Open the VBA Editor: Click 'Macros' or the VBA Editor icon to paste your image manipulation script.
- 4. Run Your Macro: Execute the script directly within WPS Office to instantly crop, resize, and rotate your image across multiple pages.

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.




