Using office spell check from VB

D

David De Bono

Hi,

I'm using VB 6 with the Word object:

Dim oWord As Word.Application
Dim oDoc As Word.Document
Dim oDic As Word.Dictionary
Dim oSuggestions As SpellingSuggestions

Set oWord = CreateObject("Word.Application")

Set oDoc = oWord.Documents.Add

Set oDic = oWord.Languages(wdEnglishUS).ActiveSpellingDictionary

Set oSuggestions = oWord.GetSpellingSuggestions(Trim$(sWord), , ,
oDic)

oDic contains the dictionary object. And it contains the correct dictionary
(MSSP3EN.LEX)


The line works fine when using the Norwegian spell checker.

When trying to use another spell language it does not fail, but returns
nothing.

If I change the default office language (Microsoft Office 2003 Laguage
settings -> Default office behaviour language) to English it works with
English spell check.

So when using the spell checker in the same laguage as office behaviour it
works.

Any ideas ?

David
 
C

Cindy M -WordMVP-

Hi David,
The line works fine when using the Norwegian spell checker.

When trying to use another spell language it does not fail, but returns
nothing.

If I change the default office language (Microsoft Office 2003 Laguage
settings -> Default office behaviour language) to English it works with
English spell check.

So when using the spell checker in the same laguage as office behaviour it
works.

Any ideas ?
Look up this article in Google Newsgroup search. I think Richard describes
what you're looking for

Automating spell check from outside Word
From: (e-mail address removed) (Richard Pearce)
Newsgroups: microsoft.public.word.international.features
Subject: MainDictionary parameter of CheckSpelling method does not work:
Workaround
Date: 1 Mar 2002 04:39:33 -0800

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top