开发者

MS Word VBA - select range, check spelling and accept first suggest

i'd like to write a macro that selects the next word to the right of the cursor, checks its spelling and replaces an error with the fir开发者_开发问答st suggestion..

can anyone with more VBA knowledge than me (..laugh) help out.

i tried the macro recorder but did not get any farther than this:

Sub FirstSuggest()
    Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
    ...
    ...

End Sub

thanks, kay


Dim r As Range
Set r = Selection.GoToNext(wdGoToSpellingError)

With r.GetSpellingSuggestions()
  If .Count > 0 Then
    r.Text = .Item(1).Name
  End If
End With
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜