Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

Font parameters in Find/Replace in Word 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MM_B - 24 Jul 2007 21:32 GMT
In Word 2003, if I use the same macro that I used to use hundreds of
times in Word 2000 to find a certain character 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've been able to use
font parameters in all other versions of Word previously.

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

It seems that this problem applies only to very common fonts, especially
ones that are defaults in HTML, like Courier New, Times New Roman, and Arial
-- but these are exactly the fonts I need to distinguish between in some of
my work.

Thanks!
zkid - 26 Jul 2007 17:34 GMT
Well, ain't that a kick in the pants.  I played around with it for quite
awhile (it occurs in XP too, by the way).  I finally punted and came up with
this solution:

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

try...

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

It seemed to work for me.

> In Word 2003, if I use the same macro that I used to use hundreds of
> times in Word 2000 to find a certain character in a certain font, the
[quoted text clipped - 24 lines]
>
> Thanks!
MM_B - 26 Jul 2007 18:16 GMT
Wow, how did you come up with that? It does work!! I posted the same question
at wopr.com, and two people there said that my macro worked for them, so I'm
at a loss to explain that. But at least now I can make mine work for me.
Thanks so much for your reply.

> Well, ain't that a kick in the pants.  I played around with it for quite
> awhile (it occurs in XP too, by the way).  I finally punted and came up with
[quoted text clipped - 7 lines]
>
> It seemed to work for me.
zkid - 26 Jul 2007 18:22 GMT
You're welcome.  I'm so glad it worked out.  I just came up with it after
playing with ranges, etc. that still didn't work.  It was one of the VBA
pop-up(drop down) selections for Selection.Find.Font.  I just thought, what
the heck, give it a try....  No need to respond.

> Wow, how did you come up with that? It does work!! I posted the same question
> at wopr.com, and two people there said that my macro worked for them, so I'm
[quoted text clipped - 12 lines]
> >
> > It seemed to work for me.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.