自定義詞典,你可能知道,只是包含的話,那麼引用Microsoft腳本運行時的文本文件,並使用:
Dim FSO As New FileSystemObject, FS As TextStream
Dim Code As String, Codes As New Scripting.Dictionary
Dim Paragraph As Paragraph, Word As Range
Set FS = FSO.OpenTextFile("c:\...\cust.dic")
Do Until FS.AtEndOfStream
Code = FS.ReadLine
If Not Codes.Exists(Code) Then Codes.Add Key:=Code, Item:=Nothing
Loop
' Use your own method for enumerating words
For Each Paragraph In ActiveDocument.Paragraphs
Set Word = Paragraph.Range
Word.MoveEnd WdUnits.wdCharacter, -1
If Not Codes.Exists(Word.Text) Then
Word.Font.Underline = wdUnderlineWavy
Word.Font.UnderlineColor = wdColorBlue
Else
Word.Font.Underline = wdUnderlineNone
Word.Font.UnderlineColor = wdColorAutomatic
End If
Next
並不理想,因爲它則會覆蓋下劃線格式,並沒有按不提供建議機制(儘管圍繞列表框構建的小表單就足夠了)。
不幸的是,最好的解決方案將涉及到擴展拼寫引擎。