473,464 Members | 1,729 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Controlled use of Access spell check possible?

There's this app I wrote a long time ago for a client who uses it to
administer the database content that drives their Web site. Last time I was
in there' I notices a lot of embarassing typos in the data, and since this
data is published on their Web site which is their primary interface to their
customers, that's a bad thing.

I was thinking it would be nice if I could automatically spell check certain
fields, and somehow use the Access spell checker to do it. The problem is,
the only way I can find to run the spell checker is with the DoCmd.RunCommand
.... This command takes no arguments, and does exactly one thing - checks the
spelling of the current control, and reports the results to the user.

There's no way to make the spell check window not display if there are no
errors, and there's no way to programmatically know whether the spell check
had a problem or not.

Does anyone know how to get more control over the spell check process in
Access?
Nov 13 '05 #1
8 9971
See whether the following helps:

Function SpellCheck_WordLB(WordToCheck As String) As Boolean
On Error GoTo Err_SpellCheck_WordLB

Dim wd As Object

If Len(WordToCheck) > 0 Then
Set wd = CreateObject("Word.Application")
SpellCheck_WordLB = wd.CheckSpelling(WordToCheck)
Else
MsgBox "You have to give me a word!"
End If

End_SpellCheck_WordLB:
If Not wd Is Nothing Then
wd.Quit
Set wd = Nothing
End If
Exit Function

Err_SpellCheck_WordLB:
MsgBox Err.Description & " (" & Err.Number & ")"
Resume End_SpellCheck_WordLB

End Function
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:c1********************************@4ax.com...
There's this app I wrote a long time ago for a client who uses it to
administer the database content that drives their Web site. Last time I was in there' I notices a lot of embarassing typos in the data, and since this
data is published on their Web site which is their primary interface to their customers, that's a bad thing.

I was thinking it would be nice if I could automatically spell check certain fields, and somehow use the Access spell checker to do it. The problem is, the only way I can find to run the spell checker is with the DoCmd.RunCommand ... This command takes no arguments, and does exactly one thing - checks the spelling of the current control, and reports the results to the user.

There's no way to make the spell check window not display if there are no
errors, and there's no way to programmatically know whether the spell check had a problem or not.

Does anyone know how to get more control over the spell check process in
Access?

Nov 13 '05 #2
Well, since all the users have MS Word installed, that should work, but it
seems pretty kludgey to have to start a whole instance of MS Word to check
spelling when Access already has the capability buried somewhere. That's
especially an issue since the users are running Office 2000 on Windows 98, and
are prone to Out of Memory errors.

On Wed, 29 Sep 2004 18:06:43 -0400, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:
See whether the following helps:

Function SpellCheck_WordLB(WordToCheck As String) As Boolean
On Error GoTo Err_SpellCheck_WordLB

Dim wd As Object

If Len(WordToCheck) > 0 Then
Set wd = CreateObject("Word.Application")
SpellCheck_WordLB = wd.CheckSpelling(WordToCheck)
Else
MsgBox "You have to give me a word!"
End If

End_SpellCheck_WordLB:
If Not wd Is Nothing Then
wd.Quit
Set wd = Nothing
End If
Exit Function

Err_SpellCheck_WordLB:
MsgBox Err.Description & " (" & Err.Number & ")"
Resume End_SpellCheck_WordLB

End Function


Nov 13 '05 #3
On Sep 29 2004, 01:48 pm, Steve Jorgensen <no****@nospam.nospam> wrote
in news:c1********************************@4ax.com:

<snip>

I was thinking it would be nice if I could automatically spell check
certain fields, and somehow use the Access spell checker to do it.
The problem is, the only way I can find to run the spell checker is
with the DoCmd.RunCommand ... This command takes no arguments, and
does exactly one thing - checks the spelling of the current control,
and reports the results to the user.

There's no way to make the spell check window not display if there are
no errors, and there's no way to programmatically know whether the
spell check had a problem or not.


Well, this is probably even a bigger kludge than using Word, but the
windows that are displayed when spell check doesn't find any errors and
when it does are quite distinct (in the former case the caption is the
app's title, in the latter it is "Spelling", and in both cases the windows
are owned by the main Access window), so you should be able to use Win32
APIs to distinguish between these two cases.

Not that I'm really suggesting that, but since you asked... ;)

--
remove a 9 to reply by email
Nov 13 '05 #4
I have the following code in a module
' ************************************************** ***************
' Got this spell checker from the Google new group and
' with some help from a contributer named Salad
' Call this from the "Lost Focus" event of a text box
Public Function SpellChecker(Calling As Form)

Dim ctlSpell As Control
Dim Incoming As String, Outgoing As String

DoCmd.SetWarnings False
Set ctlSpell = Calling.ActiveControl
If (ctlSpell.Locked) Then
Line1 = "Cannot spell check. Field is read-only"
mbResult = MessageBox("OK", "", "", Line1)
Else
If Len(ctlSpell) > 0 Then
Incoming = ctlSpell
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
End With
DoCmd.RunCommand acCmdSpelling
Outgoing = ctlSpell
End If
' See if any changes were made 09/29/04
If (Incoming <> Outgoing) Then
' Notify user that changes
' were made, if you want to,
' or give Bronx cheer
End If
End If

End Function

From any text box on any form call the funtion
' ************************************************** *****
' Automatically spell check this control 09/27/04
Private Sub GeneralMessage_LostFocus()

SpellChecker Me

End Sub

Hank Reed
Nov 13 '05 #5
Neat - that looks like a good starting point.

On 30 Sep 2004 02:37:34 -0700, ha********@aol.com (Hank Reed) wrote:
I have the following code in a module
' ************************************************** ***************
' Got this spell checker from the Google new group and
' with some help from a contributer named Salad
' Call this from the "Lost Focus" event of a text box
Public Function SpellChecker(Calling As Form)

Dim ctlSpell As Control
Dim Incoming As String, Outgoing As String

DoCmd.SetWarnings False
Set ctlSpell = Calling.ActiveControl
If (ctlSpell.Locked) Then
Line1 = "Cannot spell check. Field is read-only"
mbResult = MessageBox("OK", "", "", Line1)
Else
If Len(ctlSpell) > 0 Then
Incoming = ctlSpell
With ctlSpell
.SetFocus
.SelStart = 0
.SelLength = Len(ctlSpell)
End With
DoCmd.RunCommand acCmdSpelling
Outgoing = ctlSpell
End If
' See if any changes were made 09/29/04
If (Incoming <> Outgoing) Then
' Notify user that changes
' were made, if you want to,
' or give Bronx cheer
End If
End If

End Function

From any text box on any form call the funtion
' ************************************************** *****
' Automatically spell check this control 09/27/04
Private Sub GeneralMessage_LostFocus()

SpellChecker Me

End Sub

Hank Reed


Nov 13 '05 #6
On Wed, 29 Sep 2004 22:30:34 GMT, Steve Jorgensen
<no****@nospam.nospam> wrote:
Well, since all the users have MS Word installed, that should work, but it
seems pretty kludgey to have to start a whole instance of MS Word to check
spelling when Access already has the capability buried somewhere. That's
especially an issue since the users are running Office 2000 on Windows 98, and
are prone to Out of Memory errors.
When I run across a user who is S T I L L using Win98, I simply tell
them to upgrade or they get no more support. Presto -- problem
solved. I all but RARE occasions, they upgrade right away. For the
ones who don't -- well it's a blessing in disguise!


On Wed, 29 Sep 2004 18:06:43 -0400, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:
See whether the following helps:

Function SpellCheck_WordLB(WordToCheck As String) As Boolean
On Error GoTo Err_SpellCheck_WordLB

Dim wd As Object

If Len(WordToCheck) > 0 Then
Set wd = CreateObject("Word.Application")
SpellCheck_WordLB = wd.CheckSpelling(WordToCheck)
Else
MsgBox "You have to give me a word!"
End If

End_SpellCheck_WordLB:
If Not wd Is Nothing Then
wd.Quit
Set wd = Nothing
End If
Exit Function

Err_SpellCheck_WordLB:
MsgBox Err.Description & " (" & Err.Number & ")"
Resume End_SpellCheck_WordLB

End Function


Nov 13 '05 #7
I know what you're saying, but this company has 100s of Windows 98 machines
and their own IT staff with their own opinions. Not much I can do about it.

On Sat, 02 Oct 2004 03:29:35 -0500, Lauren Wilson <???@???.???> wrote:
On Wed, 29 Sep 2004 22:30:34 GMT, Steve Jorgensen
<no****@nospam.nospam> wrote:
Well, since all the users have MS Word installed, that should work, but it
seems pretty kludgey to have to start a whole instance of MS Word to check
spelling when Access already has the capability buried somewhere. That's
especially an issue since the users are running Office 2000 on Windows 98, and
are prone to Out of Memory errors.


When I run across a user who is S T I L L using Win98, I simply tell
them to upgrade or they get no more support. Presto -- problem
solved. I all but RARE occasions, they upgrade right away. For the
ones who don't -- well it's a blessing in disguise!


On Wed, 29 Sep 2004 18:06:43 -0400, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:
See whether the following helps:

Function SpellCheck_WordLB(WordToCheck As String) As Boolean
On Error GoTo Err_SpellCheck_WordLB

Dim wd As Object

If Len(WordToCheck) > 0 Then
Set wd = CreateObject("Word.Application")
SpellCheck_WordLB = wd.CheckSpelling(WordToCheck)
Else
MsgBox "You have to give me a word!"
End If

End_SpellCheck_WordLB:
If Not wd Is Nothing Then
wd.Quit
Set wd = Nothing
End If
Exit Function

Err_SpellCheck_WordLB:
MsgBox Err.Description & " (" & Err.Number & ")"
Resume End_SpellCheck_WordLB

End Function


Nov 13 '05 #8
On Sat, 02 Oct 2004 03:29:35 -0500, Lauren Wilson <???@???.???> wrote:
When I run across a user who is S T I L L using Win98, I simply tell
them to upgrade or they get no more support. Presto -- problem
solved. I all but RARE occasions, they upgrade right away. For the
ones who don't -- well it's a blessing in disguise!

Hi
You're right of course but we get most of our business from companies
whose IT departments treat them like this!
David

Nov 13 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

84
by: Andy Glew | last post by:
I am in search of any rigourous, scientific, academic or industrial studies comparing naming conventions in C++ or similar languages such as Ada: Specifically, are names formed with...
2
by: eddie wang | last post by:
Hello, I inherited an Access application from a previous coworker. It seems the Spell Check is never enabled unless I open the application by holding down the shift key and double clicking the...
2
by: Cassie Pennington | last post by:
Is there a command to spell check fields in Access (probably in the afterupdate event)? Thanks in anticipation Cassie
2
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens...
0
by: LowRyder | last post by:
I haven't been able to find any fixes for this. I have a form with two memo fields. Sometimes when you push the spell check button or press F7 the spell check goes into an infinite loop. If you...
1
by: dinoo | last post by:
I would appreciate if some one can help me out. We are using Microsoft Word's spell check functionality in one of our web pages based on the requirement. We are using Microsoft PIA assemblies to...
4
by: jamesnkk | last post by:
I have seen posting on Spell check problem, but seem like not solution. Therefore I post this question again. How can I spell check on one record and on one field such as Notes in my Form. MS...
3
by: Kelii | last post by:
I've been beating my head against this problem for the last several days, and I haven't found a decent solution yet. So I'm turning to the group for some moral support or better yet some answers. ...
9
by: ARC | last post by:
Hello all, I developed a tool a year or so ago for adding your own spell-checker to an access application. This is mainly for those using the runtime, as you can't distribute the spell-checker...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.