Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Word Object Library / Spelling Checker

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Norrie - 09 Jan 2006 16:10 GMT
Hi,
I am currently developing a project which involves the storage/retrieval of
Word documents to/from a SQL Server database.
The user is required to be able to select a document from a list of stored
documents and press a button which should extract the relevant document from
the database and open it within Word to allow the document to be edited.
The problem that I am currently experiencing is that once the document has
been launched within Word, the "Check spelling as you type" option is
checked, but word acts as if this option was switched off.
Below is a snippet of code used to launch the document:

Public Sub OpenDocument(sFileName As String)
   Dim oWord As Word.Application
   Dim oDoc As Word.Document
 
   Set oWord = CreateObject("Word.Application")
   Set oDoc = oWord.Documents.Open(sFileName)
   oDoc.Activate
   oWord.Visible = True
   oWord.Activate
End Sub

Any help in this matter would be greatly appreciated as it is slowly driving
me mad.

Cheers,
Norrie
Doug Robbins - Word MVP - 09 Jan 2006 18:36 GMT
Maybe you need to add a line

ODoc.Range.NoProofing = False

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hi,
> I am currently developing a project which involves the storage/retrieval
[quoted text clipped - 26 lines]
> Cheers,
> Norrie
Norrie - 10 Jan 2006 09:30 GMT
Hi Doug,
Firstly i'd like to thank you for your reply to my question.
I tried your solution without any success.  The original document that i am
currently working on in a test basis contained words that are not present
within the current dictionary (e.g. (Hons)) and adding this additional line
resulted in these words not being underlined in red.  Also my original
problem whereby newly added text was not being underlined if mis-spelled
still persists.
I noticed by chance that if i put a break-point on the line that reads
"oDoc.Activate" to stop program execution, then resume execution from this
point that the problems all seem to clear-up and words acts as i would
expect.  With this in mind, i tried to place a pause in the code prior to
this line (unsing the API Sleep function), but unfortunately this had no
effect.
Thanks again,
Norrie.

> Maybe you need to add a line
>
[quoted text clipped - 30 lines]
> > Cheers,
> > Norrie
Cindy M  -WordMVP- - 10 Jan 2006 10:17 GMT
Hi =?Utf-8?B?Tm9ycmll?=,

> I am currently developing a project which involves the storage/retrieval of
> Word documents to/from a SQL Server database.
[quoted text clipped - 4 lines]
> been launched within Word, the "Check spelling as you type" option is
> checked, but word acts as if this option was switched off.

How about if you toggle the option off and back on to "give it a kick"? Or if
you trigger the "Recheck" functionality?

The check spelling as you type can get locked out. One reproducible way is if a
file contains too many spelling errors. Other than that, it just seems to have
something to do with the state of the document at some critical juncture. It's
usually possible (in the UI, anyway) to get it back doing something or other in
the options, or by running a full check.

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 :-)
Norrie - 10 Jan 2006 10:55 GMT
Hi Cindy,
Thank you for your response to my problem.
Unfortunately I had already tried the "switch it off, then back on again"
approach, which did not solve the problem.  
Whilst experimenting farther, i found a solution (not very elegant but seems
to work).  The solution that i found was to force word to activate its
spell-checker by adding the line 'oWord.CheckSpelling ("a")' directly after
the document was opened.
Thank you again for your response,
Norrie.

> Hi =?Utf-8?B?Tm9ycmll?=,
>
[quoted text clipped - 23 lines]
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.