Thread: [Solved] vba control of shading
View Single Post
 
Old 04-08-2021, 01:28 AM
Tony Tony is offline Windows 10 Office 2019
Novice
 
Join Date: Apr 2021
Posts: 12
Tony is on a distinguished road
Default test.docx

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.
Attached Files
File Type: docx test.docx (18.2 KB, 12 views)

Last edited by Tony; 04-08-2021 at 05:04 PM. Reason: added link to screenshot
Reply With Quote