![]() |
#16
|
|||
|
|||
![]()
Thank you, macropod, for your code. I tried it on the test.docx I provided and it seems to work for the first line.
But then it seems to get stuck in this loop when it hits a particular wdColorAutomatic Code:
Do While .End < Rng.End - 1 If .Characters.Last.Next.Font.Shading.BackgroundPatternColor = _ .Characters.First.Font.Shading.BackgroundPatternColor Then .End = .End + 1 Else Select Case .Font.Shading.BackgroundPatternColor Case wdColorAutomatic Case wdColorWhite: .Collapse wdCollapseEnd Case Else ... End Select |
#17
|
|||
|
|||
![]()
I only mentioned the "comments/notes" part because I was asked early on by gmayor what my aim was. But that has nothing to do with the current problem.
I need to solve the current problem with not being able to locate each colored shading range. Only then I will introduce comments/notes. But the current documents have no comments/notes. |
#18
|
||||
|
||||
![]()
The code works fine for me with your test document.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#19
|
|||
|
|||
![]()
macropod: The code works fine for me with your test document.
I just tried it again and it works fine for the first 4 highlights (in the first line) but then it get's stuck and never finds the highlight info for the turquoise " uif 5ifbwfot boe u" Do you get info for that one? |
#20
|
||||
|
||||
![]()
I developed and tested the code on your original attachment. It works equally well on your updated attachments, returning 19 range reports.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
ajanson | Word | 3 | 08-15-2016 04:49 PM |
![]() |
DougsGraphics | Word VBA | 2 | 06-24-2015 07:31 AM |
![]() |
tluken | Word | 1 | 08-23-2012 10:20 AM |
![]() |
WilltheGrill09 | Word | 1 | 03-27-2012 02:44 AM |
![]() |
b0x4it | Word | 4 | 05-18-2011 07:54 PM |