Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Dan-_78 Dan-_78 is offline
external usenet poster
 
Posts: 1
Default Using wildcards in the custom.dic

Hello,
I want to add an entry to the custom.dic that will cause the spell checker
to ignore the spelling of any word that has the underscore character in it. I
think I could do this using the wildcard character, but I can't seem to find
a 'wildcard' that works.

For example, I want Word to NOT check the spelling of any of the following
strings: id_enable, grep_should_pass, clk_is_blocked, cntr_load_en, and so
forth.

I've tried adding *_* to custom.dic and ?_? but the spell checker still
insists on saying that any word with an underscore is mis-spelled.

Any suggestions on how to fix this? Is there an approach to solving this
other than using an entry in the custom.dic?

Thanks,
Dan
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Using wildcards in the custom.dic

The custom dictionary can't do anything like this -- it's just a list of
specific strings that the speller consults before labeling something as an
error.

You can do a wildcard Find/Replace to achieve this. First click the More
button in the Replace dialog and check the box for "Use wildcards". In the
Find What box, enter the expression

*_*

which represents any word containing an underscore. In the Replace With box,
enter

^&

which represents "the text that was found". While the cursor is still in the
Replace With box, click the Format button, choose Language from the menu,
and put a check mark in the "Do not check spelling or grammar" box. Finally,
click the Replace All button. Every work that contains an underscore will be
marked to be ignored by the speller.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Dan-_78 wrote:
Hello,
I want to add an entry to the custom.dic that will cause the spell
checker to ignore the spelling of any word that has the underscore
character in it. I think I could do this using the wildcard
character, but I can't seem to find a 'wildcard' that works.

For example, I want Word to NOT check the spelling of any of the
following strings: id_enable, grep_should_pass, clk_is_blocked,
cntr_load_en, and so forth.

I've tried adding *_* to custom.dic and ?_? but the spell checker
still insists on saying that any word with an underscore is
mis-spelled.

Any suggestions on how to fix this? Is there an approach to solving
this other than using an entry in the custom.dic?

Thanks,
Dan



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Dan-_78[_2_] Dan-_78[_2_] is offline
external usenet poster
 
Posts: 1
Default Using wildcards in the custom.dic

Thanks Jay, that is something that I can do on a document by document basis.

But, is there any way to automate this? Maybe a macro or something that
performs this sequence when I tell it to? Or better yet, something that
performs this sequence every time I open a document?

I don't know much about Word macros in all honesty. In gvim I could use
something like an autocmd to run the macro everytime I open a document. I'm
guessing Word also has something similar that will run everytime I open a
document?

I'll hunt around for education about Word macros, but if this is a 'no
brainer' for some of you Word wizards, guidance would be appreciated.

Regards,
Dan


"Jay Freedman" wrote:

The custom dictionary can't do anything like this -- it's just a list of
specific strings that the speller consults before labeling something as an
error.

You can do a wildcard Find/Replace to achieve this. First click the More
button in the Replace dialog and check the box for "Use wildcards". In the
Find What box, enter the expression

*_*

which represents any word containing an underscore. In the Replace With box,
enter

^&

which represents "the text that was found". While the cursor is still in the
Replace With box, click the Format button, choose Language from the menu,
and put a check mark in the "Do not check spelling or grammar" box. Finally,
click the Replace All button. Every work that contains an underscore will be
marked to be ignored by the speller.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Dan-_78 wrote:
Hello,
I want to add an entry to the custom.dic that will cause the spell
checker to ignore the spelling of any word that has the underscore
character in it. I think I could do this using the wildcard
character, but I can't seem to find a 'wildcard' that works.

For example, I want Word to NOT check the spelling of any of the
following strings: id_enable, grep_should_pass, clk_is_blocked,
cntr_load_en, and so forth.

I've tried adding *_* to custom.dic and ?_? but the spell checker
still insists on saying that any word with an underscore is
mis-spelled.

Any suggestions on how to fix this? Is there an approach to solving
this other than using an entry in the custom.dic?

Thanks,
Dan




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Using wildcards in the custom.dic

Oops, I should have checked a little closer. Because of a quirk of the *
wildcard, that search term would mark the entire document as "do not check".
Instead, use this one:

[A-Za-z]@_[A-Za-z]@

followed by another pass with this one to catch the last part of any item
that contains more than one undersco

_*

or, if the underscored words could contain numbers, use this as the first
pass:

[A-Za-z0-9]@_[A-Za-z0-9]@

Jay Freedman wrote:
The custom dictionary can't do anything like this -- it's just a list
of specific strings that the speller consults before labeling
something as an error.

You can do a wildcard Find/Replace to achieve this. First click the
More button in the Replace dialog and check the box for "Use
wildcards". In the Find What box, enter the expression

*_*

which represents any word containing an underscore. In the Replace
With box, enter

^&

which represents "the text that was found". While the cursor is still
in the Replace With box, click the Format button, choose Language
from the menu, and put a check mark in the "Do not check spelling or
grammar" box. Finally, click the Replace All button. Every work that
contains an underscore will be marked to be ignored by the speller.


Dan-_78 wrote:
Hello,
I want to add an entry to the custom.dic that will cause the spell
checker to ignore the spelling of any word that has the underscore
character in it. I think I could do this using the wildcard
character, but I can't seem to find a 'wildcard' that works.

For example, I want Word to NOT check the spelling of any of the
following strings: id_enable, grep_should_pass, clk_is_blocked,
cntr_load_en, and so forth.

I've tried adding *_* to custom.dic and ?_? but the spell checker
still insists on saying that any word with an underscore is
mis-spelled.

Any suggestions on how to fix this? Is there an approach to solving
this other than using an entry in the custom.dic?

Thanks,
Dan



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Using wildcards in the custom.dic

Here's a macro that does the same thing as my other post, which crossed yours.

Sub NonSpellUnderscores()
Dim oRg As Range
Set oRg = ActiveDocument.Range
With oRg.Find
.MatchWildcards = True
.Text = "[A-Za-z]@_[A-Za-z]@"
.Replacement.Text = "^&"
.Replacement.NoProofing = True
.Execute Replace:=wdReplaceAll
End With
Set oRg = ActiveDocument.Range
With oRg.Find
.MatchWildcards = True
.Text = "_*"
.Replacement.Text = "^&"
.Replacement.NoProofing = True
.Execute Replace:=wdReplaceAll
End With
ActiveDocument.SpellingChecked = False
ActiveDocument.CheckSpelling
End Sub

See http://www.gmayor.com/installing_macro.htm if you need instructions on what
to do with it.

To make it run every time you open any document, place the macro in the
Normal.dot template and change the first line from Sub NonSpellUnderscores() to

Sub AutoOpen()

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.

On Fri, 17 Apr 2009 10:20:13 -0700, Dan-_78
wrote:

Thanks Jay, that is something that I can do on a document by document basis.

But, is there any way to automate this? Maybe a macro or something that
performs this sequence when I tell it to? Or better yet, something that
performs this sequence every time I open a document?

I don't know much about Word macros in all honesty. In gvim I could use
something like an autocmd to run the macro everytime I open a document. I'm
guessing Word also has something similar that will run everytime I open a
document?

I'll hunt around for education about Word macros, but if this is a 'no
brainer' for some of you Word wizards, guidance would be appreciated.

Regards,
Dan


"Jay Freedman" wrote:

The custom dictionary can't do anything like this -- it's just a list of
specific strings that the speller consults before labeling something as an
error.

You can do a wildcard Find/Replace to achieve this. First click the More
button in the Replace dialog and check the box for "Use wildcards". In the
Find What box, enter the expression

*_*

which represents any word containing an underscore. In the Replace With box,
enter

^&

which represents "the text that was found". While the cursor is still in the
Replace With box, click the Format button, choose Language from the menu,
and put a check mark in the "Do not check spelling or grammar" box. Finally,
click the Replace All button. Every work that contains an underscore will be
marked to be ignored by the speller.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Dan-_78 wrote:
Hello,
I want to add an entry to the custom.dic that will cause the spell
checker to ignore the spelling of any word that has the underscore
character in it. I think I could do this using the wildcard
character, but I can't seem to find a 'wildcard' that works.

For example, I want Word to NOT check the spelling of any of the
following strings: id_enable, grep_should_pass, clk_is_blocked,
cntr_load_en, and so forth.

I've tried adding *_* to custom.dic and ?_? but the spell checker
still insists on saying that any word with an underscore is
mis-spelled.

Any suggestions on how to fix this? Is there an approach to solving
this other than using an entry in the custom.dic?

Thanks,
Dan




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Includetext and wildcards Fev Microsoft Word Help 2 April 1st 09 07:02 AM
HOW DO I ENABLE WILDCARDS? Larry8686 Microsoft Word Help 4 October 17th 07 09:49 PM
custom dictionary/wildcards Steve Microsoft Word Help 1 August 1st 07 05:30 PM
Using wildcards for whole phrases richardbelldc Microsoft Word Help 2 March 30th 07 06:08 AM
LISTNUM & Wildcards Fuzzhead Microsoft Word Help 14 May 16th 06 07:23 PM


All times are GMT +1. The time now is 04:00 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"