Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    May 2003
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find/replace - color vs. style problem (Word 2000)

    Problem: I've got at document with headings formatted with style = normal and textcolor red. I want to use the find replace-function to replace red-colored text with heading 1. When I do that the correct texts are formatted with heading 1, BUT the text is still red. I then tried to apply automatic color in the find/replace box. Then - offcourse - the text became black, but when i update the style Heading 1 to an other color the headings still don't follow the Heading 1 text color.

    So - how can I define a find/replace so the text totally follows the styles format - including color?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find/replace - color vs. style problem (Word 2000)

    In Word 2002 you can select all found pieces of text at once, but this is not available in Word 2000.

    The following macro does what you want, but I hope that somebody else comes up with an easier solution - a macro seems overkill for this "everyday" problem.

    Sub Red2Heading1()
    With Selection.Find
    .ClearFormatting
    .Text = ""
    .Format = True
    .Font.Color = wdColorRed
    Do While .Execute
    Selection.Style = wdStyleHeading1
    Selection.ParagraphFormat.Reset
    Selection.Collapse wdCollapseEnd
    Loop
    End With
    End Sub

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Find/replace - color vs. style problem (Word 2

    Phil,

    I posted a reply almost identical to yours, and then had to delete it when I realised that it only appeared to do the correct thing. It had actually applied the default colour of the Heading 1 font as direct formatting. If I then changed the font colour of Heading 1, these headings didn't change with it until I did a Font.Reset on them.

    StuartR

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find/replace - color vs. style problem (Word 2

    Hi Stuart:
    You're absolutely correct! I checked with Shift+F1, which did NOT indicate that there was any direct formatting. I've modified my post to include a second step. Thanks.

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find/replace - color vs. style problem (Word 2

    <P ID="edit" class=small>(Edited by Phil Rabichow on 20-Oct-03 18:56. to correct the defects that Stuart has pointed out.)</P>Hi Solomon:
    Try this:
    Find: leave blank but use Format/Style/normal AND Format/Font/Red color
    Replace: leave blank but use Format/Style/Heading 1 AND Format/Font/Automatic color

    This will replace all normal styled red font with Heading 1 style & use the color of the Heading 1 style. However, as Stuart has pointed out, this changes the color, but leaves it as direct formatting. You must do another Find/Replace where you Find: Heading 1 style & Replace with: default paragraph font (under Format/Style in the Find/Replace dialog box.

    Alternatively, IF you have NO direct formatting in your document & have already replaced the normal red characters with red Heading 1 characters, you can select everything & press Ctrl+Spacebar (to remove character formatting) & Ctrl+Q to remove direct paragraph formatting.
    Cheers,

  6. #6
    New Lounger
    Join Date
    May 2003
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find/replace - color vs. style problem (Word 2

    Thanks! It just did miracles...

Posting Permissions

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