Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jun 2001
    Location
    USA
    Posts
    708
    Thanks
    48
    Thanked 1 Time in 1 Post

    Find and Replace (2002 SP3)

    Hi,

    I want to replace all instances of

    1. "Q:"

    2. "A:"

    where both the letter and the colon are bold, with a bold letter and a nonbold colon.

    E.g., Q: -> Q:

    But rather than allow me to format some characters, Word's Find and Replace function allows me only to format all or none.

    Any ideas? Thanks!

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

    Re: Find and Replace (2002 SP3)

    You can search for Q: and A: using wildcards, but you cannot specify a format for only part of the text in the Replace with box. You need VBA for that:
    <code>
    Sub UnboldColon()
    Selection.HomeKey Unit:=wdStory
    With Selection.Find
    .ClearFormatting
    .Text = "[QA]:"
    .Replacement.ClearFormatting
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .Font.Bold = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchAllWordForms = False
    .MatchSoundsLike = False
    .MatchWildcards = True
    Do While .Execute
    Selection.Characters(2).Font.Bold = False
    Loop
    End With
    End Sub</code>

  3. #3
    5 Star Lounger
    Join Date
    Jun 2001
    Location
    USA
    Posts
    708
    Thanks
    48
    Thanked 1 Time in 1 Post

    Re: Find and Replace (2002 SP3)

    Hans,

    I don't know how you did it, but it worked! Thanks so much!

Posting Permissions

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