Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
Includetext and wildcards | Microsoft Word Help | |||
HOW DO I ENABLE WILDCARDS? | Microsoft Word Help | |||
custom dictionary/wildcards | Microsoft Word Help | |||
Using wildcards for whole phrases | Microsoft Word Help | |||
LISTNUM & Wildcards | Microsoft Word Help |