Fix a Word Shape Fill Color Not Changing from Access VBA
Question details
The user needs Access VBA to change the fill color of a shape in a Word document.

- Product
- Microsoft Access VBA and Microsoft Word
- Device & OS
- not provided
- Scenario
- Access VBA opens a Word document and sets a shape's fill color.
- Observed behavior
- The code runs without a visible change to the shape's color.
Open the Access VBA procedure and identify the variables holding the Word application and document. In Word, select the target shape and check its name in the Selection Pane so you can reference the correct object.
Restore error reporting and set the correct Word shape's fill color
Use this approach when Access VBA runs without visibly changing the Word shape and errors may be suppressed.
In the Access VBA editor, find the block that uses On Error Resume Next with GetObject or New Word.Application. Add On Error GoTo 0 immediately after that block so errors in the remaining code are reported.
After On Error GoTo 0, check whether the Word application variable is Nothing. If it is, stop the procedure and investigate why Word could not be obtained or created before accessing the document.
In Word, open Home > Select > Selection Pane and confirm the shape's name. In the VBA editor, use the variable for the opened document and the matching name, for example: wdDoc.Shapes("Rectangle 1").Fill.ForeColor.RGB = RGB(255, 0, 0). Replace wdDoc and the shape name with those used in your procedure.
Run the procedure from the Access VBA editor. If an error appears, use Debug to inspect the highlighted line. In Word, verify that the displayed document and selected shape are the ones your code changed.
Once the fill looks correct, save the document in Word or call wdDoc.Save using your document variable.

Edit Word Documents with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for editing documents and changing shape formatting. Its Microsoft Office format support helps you move existing files into WPS; it does not fix Access VBA automation.

Frequently Asked Questions
Why does the VBA code run without showing an error?
On Error Resume Next suppresses subsequent runtime errors until error handling is changed. Add On Error GoTo 0 after the GetObject or New Word.Application block to make later errors visible.
How do I find the Word shape's name?
In Word, open Home > Select > Selection Pane. Select the shape and use its listed name in the document's Shapes collection.
What if the correct shape still looks unchanged?
Confirm that the code references the document displayed in Word and that the shape's fill is visible and not fully transparent. A shape inside a group or an inline object may need a different reference.
Does changing the fill color save the document automatically?
No. After checking the result, save the document in Word or call Save on the Word document variable in your Access VBA procedure.




