Results 1 to 13 of 13
  1. #1
    New Lounger
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Font search parameters in Word 2003 (Word 2003 SP

    In Word 2003, if I use the same macro that I used to use hundreds of
    times in Word 2000 to find text in a certain font, the
    macro doesn't work. There is some sort of difference which I can see
    if I look in the Find dialog box after running the macro search:
    under the search box where it shows the font, it says Font: (Default)
    Courier New. But if I create the search manually in the dialog box
    and just select Courier New in the dialogs, then in the Find dialog
    box it shows Font: Courier New [as it always used to] AND -- now the
    search works! Is there any way to specify the font name within the
    macro in Word 2003 without ending up with that "Default" bit? I have
    always been able to use font parameters in searches in previous versions of Word.

    This is in Word 2003 SP2, on Windows XP SP2. And I specify the font
    name within the macro in either of these two ways but get the same
    result:

    right before the Find loop, either:

    Selection.Find.Font.Name = "Courier New"

    or With Selection.Find.Font .Name = "Courier New" End With

    The problem appears to be limited to very common fonts, like Courier New,
    Times New Roman, and Arial (default fonts in HTML). But in my work sometimes
    these are exactly the fonts in which I need to find something.

    Thanks!

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

    Re: Font search parameters in Word 2003 (Word 2003 SP

    Welcome to Woody's Lounge!

    Just a guess: does it make a difference if you clear the check box "Keep track of formatting" in the Edit tab of Tools | Options?

  3. #3
    New Lounger
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font search parameters in Word 2003 (Word 2003

    Hi Hans,

    That does not make a difference. Thanks, though!

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

    Re: Font search parameters in Word 2003 (Word 2003

    Would it be possible to attach a small document with the macro and some text that demonstrates the problem? You can replace sensitive or proprietary text with dummy text. That would enable others to investigate the problem directly.

  5. #5
    New Lounger
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font search parameters in Word 2003 (Word 2003

    You wouldn't even need any special text. Run this macro in any document. Then, open the Find dialog box and you'll see the "[Default]" thing I"m talking about. The macro looks for any letter character in the Courier New font. But, if you change the font in the macro to something more unusual, like Castellar or Palatino, it will work (you'd have to have that font in the document, of course), and you won't see the "[Default]" indicator:

    Sub TestFindFont
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Font.Name = "Courier New"
    With Selection.Find
    .Text = "[a-z]"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = True
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    End Sub

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

    Re: Font search parameters in Word 2003 (Word 2003

    OK. The code works as expected (without [Default]) in Word 2002. If nobody else replies in the meantime, I'll test it tomorrow morning (European time) on a PC with Word 2003.

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

    Re: Font search parameters in Word 2003 (Word 2003

    This code successfully finds text with the Courier New font for me on Word 2003 SR2, but it does display (default) in the dialog box, as you describe.

    StuartR

  8. #8
    New Lounger
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font search parameters in Word 2003 (Word 2003

    well, that's an interesting wrinkle. I wonder what's different between our systems -- so far I've asked five different groups/mailing lists, etc., and you are the first person for whom this works.

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

    Re: Font search parameters in Word 2003 (Word 2003

    I've tested the code in Word 2003 now, and
    a) it does find text formatted with Courier New
    [img]/forums/images/smilies/cool.gif[/img] the dialog does display (Default) Courier New afterwards.
    See screenshot.
    Note that the code only finds lower case letters, since searching with wildcards is always case-sensitive. If you want to find both uppercase and lowercase letters, you should search for [a-zA-Z]

  10. #10
    New Lounger
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font search parameters in Word 2003 (Word 2003

    Hi Hans,
    In the original macro, I was not searching on wildcards. I changed it to use wildcards just for demo purposes since I didn't know what would be in your file. It's not the wildcards that create the problem. OK, so it's obviously possible for the search to work since it works for you, but I don't know where to look to find the problem, since you two in this forum are the only people who have said it works for them (I've asked DailyWordTips, Word-PC, and Jack Lyon, plus one more source that hasn't responded.) When I try it, the search will not work in Courier New, Times New Roman, or Arial, but it will work with a less common font, like Castellar. What could be different for you than for all the rest of us?

    Thanks,
    Margaret

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

    Re: Font search parameters in Word 2003 (Word 2003

    I use a plain vanilla Word 2003 installation at work, so I don't think my situation is special.

    Try Phil Rabichow's <!post=Systematic Approach to Behavioral Problems in Word,197827>Systematic Approach to Behavioral Problems in Word<!/post> - perhaps you can find the culprit.

  12. #12
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font search parameters in Word 2003 (Word 2003

    It probably has to do with language support for some exotic languages ... something about OpenType Layout Tables.

    Simple fonts don't have these tables, but the bigger fonts that contain Hebrew, Arab, Asian... glyphs do.
    If I understand these issues correctly (not sure), these fonts are mapped by Word.
    In effect the layout tables are handles as if they were different fonts: One for Latin/western (Ascii) text, one for bidirectional (Hebrew or Arab) text, one for Asian text, and one for other complex scripts.

    The work-around if this leads to problems is to use Font.NameAscii instead of Font.Name in the macro.
    I saw the original poster already got that info in the MS newsgroups... just for the record here, in case somebody else stumbles on this issue.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  13. #13
    Bronze Lounger
    Join Date
    Apr 2001
    Location
    Peterborough, Ontario, Canada
    Posts
    1,450
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Font search parameters in Word 2003 (Word 2003 SP

    If you have gone from Office 2000 to 2003, then most if not all of your fonts will have gone from being TrueType to OpenType, and the filenames for them will be different. Just changing the version number to a more recent version of an OpenType font has changed the filenames in some cases. The font name stays the same, but the filename (in WindowsFonts) is different.

    I don't know if that has a bearing on your problem or not, but it can be a source of confusion.

Posting Permissions

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