How do I set up spell checker to ignore filenames?

A

AlanW

Word 2003. How do I set up spell checker to ignore filenames? imparticular
filenames ending in ".png" ?
 
G

garfield-n-odie [MVP]

If the filename includes the full path (e.g.,
C:\foldername\filename.png), then you can choose to "Ignore internet and
file addresses" in Tools | Options | Spelling & Grammar tab.

If you type the filename in upper case, then you can choose to "Ignore
words in UPPERCASE" in Tools | Options | Spelling & Grammar tab.

You can create a character style formatted as "no proofing" (Format |
Styles and Formatting | New Style | Name: <enter a style name> | Style
type: Character | Format | Language | check the "Do not check spelling
or grammar" box | OK | check the "Add to template" box | OK, and apply
the character style to the filename after you type it.
 
A

AlanW

Thanks for that. Your instructions were clear and worked. I've learnt
something. my filenames are in the format "xyz-abs.png" so I had to try the
2nd solution. That really is too long winded for my purposes.

Wouldn't it be nice if the F7 spell check box had a drop down "Ignore" box,
where the user could just type "*.png " (where * is a wildcard) and anything
ending in ".png" would then be ignored in the spell check?
 
A

AlanW

Actually, I should have wrote that I had to resort to the 3rd suggestion,
and its far simpler for me to just keep on pressing "Ignore Once". But please
think about my suggestion.
 
G

garfield-n-odie [MVP]

I kinda thought maybe you meant the 3rd suggestion. Creating a "no
proofing" character style might be a bit long-winded, but you only have
to do it once.

Click on Format | Styles and Formatting, and keep the Styles and
Formatting taskpane displayed on the right side of the screen all the
time to make it easier to apply a certain style. Then when you type a
filename, select it and click on the "no proofing" character style you
created earlier on the Styles and Formatting taskpane to apply the style
to the selected text. Select, one click to apply style, done... no more
clicking on "ignore once" over and over.

I don't disagree with your suggestion, but we MVPs don't work for
Microsoft.
 
G

Graham Mayor

You could run the following macro which will mark all *.png filenames as 'no
proofing' http://www.gmayor.com/installing_macro.htm

Sub ReplaceExample()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
'**********************
.Text = "*.png"
.Replacement.Text = "^&"
.Replacement.NoProofing = True
'**********************
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

and it would not be too much of a stretch to make it work for any selection
of filenames

eg

Sub ReplaceList()
Dim vFindText As Variant
Dim vReplText As String
Dim i As Long

vFindText = Array("*.png", "*.jpg", "*.bmp", "*.gif")
vReplText = "^&"
Selection.HomeKey wdStory
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText
.Replacement.NoProofing = True
.Execute Replace:=wdReplaceAll
Next i
End With
End Sub

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

It should affect only "ordinary words" ending in "png." How many of those
are there?
 
G

Graham Mayor

It should only affect words ending in .png ie with a period before the png!
If your spelling is that bad, there's not much hope for a solution. :(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

AlanW

I ran the ReplaceList macro above, on a test Word 2003 document with the
following test data: "Abstain thraed needle point piont gre-er-er.bmp
hydyd.jpg great.png work.gif oe-this-work.ans open file fiel frlie"
Then I did an F7 on it.
The ONLY spell check caught was oe-this-work.ans, and not "piont" or "frlie" .
 
G

Graham Mayor

I have just copied your message into Word and run the macro I posted
earlier. oe-this-work.ans, "piont" and
"frlie" were each flagged as in error You could add *.ans to the array to
catch the first, but it seems you may have added the others to your personal
dictionary, they are already marked with the no formatting parameter, or
they are legitimate words in the language you are using to spell check. The
macro does not affect either of them.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top