View Single Post
  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How do I set up spell checker to ignore filenames?

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
Word MVP web site http://word.mvps.org


AlanW wrote:
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.