这是一个非常好的建议,但MS WORD VBA 中没有字典对象的具体条目数和KEY等对象,无法访问这些词典,我变通了一下,在自动更正的英文单词中随机生成,尽管数量少了一些,权当娱乐。 '* +++++++++++++++++++++++++++++
'* Created By I Love You_Word!@ExcelHome 2001-2-24 7:11:34
'仅测试于System: Windows NT Word: 10.0 Language: 2052
'№ 00074^The Code CopyIn [ThisDocument-ThisDocument]^'
'* -----------------------------Option Explicit
Dim myEnglish() As String
Sub Example()
Dim acEntry As AutoCorrectEntry
Dim strEntry As String
Dim EnCount As Integer
For Each acEntry In AutoCorrect.Entries
strEntry = acEntry.Value
If strEntry Like "[a-z]*" Or strEntry Like "[A-Z]*" Then
ReDim Preserve myEnglish(EnCount)
myEnglish(EnCount) = strEntry
EnCount = EnCount + 1
End If
Next acEntry
End Sub
'----------------------
Sub RndEnglish()
Dim max As Integer, myNumber As Integer
max = UBound(myEnglish)
myNumber = VBA.Rnd * max + 1
MsgBox myEnglish(myNumber)
End Sub
'---------------------- |