Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Location
    Annapolis, Maryland, USA
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Finding mixed formatting (2002)

    I'm working on a dictionary, and the volume of cross references is really bogging me down. I'm going to need to go back through the ms. to double check the terms that have a cross reference but no definition beyond that.

    Is there a way to search for a bold period followed by a space (bold or not) and then the word "See" in liteface?
    Michael Coleman
    BOMI International

  2. #2
    3 Star Lounger
    Join Date
    Apr 2004
    Location
    Boston, Massachusetts, USA
    Posts
    389
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding mixed formatting (2002)

    While you can replace with the contents of the clipboard, I don't think you can search for the contents of the clipboard, which would seem to be the best option here. Offhand, I can't think of an easy way to search for mixed formatting.

    The following macro will highlight text that matches your conditions in bright green. You could change that to something else, or use that as a way to search: highlight all the matches, then do a Find for higlighted text. Once you checked all the references, you could clear the highlighting.

    <pre>Sub FindSeeAlso()
    Dim rngToSearch As Range
    Dim rngResult As Range
    Dim w As Range
    Set rngToSearch = ActiveDocument.Range
    Set rngResult = rngToSearch.Duplicate

    Do
    With rngResult.Find
    .ClearFormatting
    .Text = ". See"
    .Forward = True
    .Wrap = wdFindStop
    .MatchWildcards = False
    .Execute
    End With

    If rngResult.Find.Found = False Then
    Exit Do
    End If

    If rngResult.Characters(1).Font.Bold = True And _
    rngResult.Words(2).Font.Bold = False Then
    '##########################
    ' Do stuff to results here
    ' (this highlights matches as an example)
    rngResult.HighlightColorIndex = wdBrightGreen
    '##########################
    End If

    rngResult.MoveStart wdWord
    rngResult.End = rngToSearch.End
    Loop Until rngResult.Find.Found = False

    End Sub
    </pre>


    This is a hack and a half, someone else might have additional suggestions.

Posting Permissions

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