Results 1 to 20 of 28

Thread: Macro cannot find shading colour black

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #21
    VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,273
    Location
    Quote Originally Posted by Aquinax View Post
    The colour 'black' is found when searched for 'yellow' by you, because the search for black is too generic inside the Word's internal coding
    Not so. There is a bug in the interaction with Find and BackgroundPatternColorIndex/BackgroundPatternColor. A Find for wdBlack Finds everything that doesn't have a Background Color. A Find for wdYellow Finds both Yellow and Black. The workaround is do a Find for wdYellow and to apply an additional test to determine which of Yellow and Black it is. That's what the code I posted does.
    Last edited by macropod; 05-15-2018 at 04:23 PM.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •