With this post I'm providing a test.docx as suggested by
Guessed.
Using this file, I tried the code provided by both Guessed and macropod but neither worked. This could be because I'm doing something wrong like not supplying the color correctly.
I ran the code I wrote on this test.docx and this screenshot:
test.png - Google Drive shows the result.
You'll notice that this is in Excel. My code is excel VBA that opens the Word document and manipulates it, extracting the range start, end point, the shaded text, and
wdColor enumeration number for the shading color. The cell interior is also colored using this number.
This test.docx is very small, and it's easy to figure out the colors. but I don't know the colors for the many documents I have.