Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating spell checker in Word97

Status
Not open for further replies.

wacker

Programmer
Aug 12, 2002
7
EU
I am trying to run the spellchecker via a toolbar button using a macro in Word97. This is working to a point, but the language keeps defaulting to EnglishUS instead of EnglishUK.

The Word document divided into sections which means that setting the language at the beginning of the spell check is only working for one section, then changing back for the other sections (after prompting to spell check the other sections).

Could someone please tell me how to set the language to EnglishUK for the whole document using VBA.
Any help would really be appreciated.

Cathy
 
Sub Macro1()
Dim oRNG As Word.Range
Dim oDOC As Word.Document

Set oDOC = ActiveDocument
For Each oRNG In oDOC.StoryRanges
oRNG.LanguageID = wdEnglishUK
Next oRNG
Set oDOC = Nothing
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top