Controlled use of Access spell check possible?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Jorgensen

    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.RunComman d
    .... 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 programmaticall y 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?
  • Douglas J. Steele

    #2
    Re: Controlled use of Access spell check possible?

    See whether the following helps:

    Function SpellCheck_Word LB(WordToCheck As String) As Boolean
    On Error GoTo Err_SpellCheck_ WordLB

    Dim wd As Object

    If Len(WordToCheck ) > 0 Then
    Set wd = CreateObject("W ord.Application ")
    SpellCheck_Word LB = wd.CheckSpellin g(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

    (no e-mails, please!)



    "Steve Jorgensen" <nospam@nospam. nospam> wrote in message
    news:c1tll0170n 1hcihif5ku2fd8i feqf99cn1@4ax.c om...[color=blue]
    > 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[/color]
    was[color=blue]
    > 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[/color]
    their[color=blue]
    > customers, that's a bad thing.
    >
    > I was thinking it would be nice if I could automatically spell check[/color]
    certain[color=blue]
    > fields, and somehow use the Access spell checker to do it. The problem[/color]
    is,[color=blue]
    > the only way I can find to run the spell checker is with the[/color]
    DoCmd.RunComman d[color=blue]
    > ... This command takes no arguments, and does exactly one thing - checks[/color]
    the[color=blue]
    > 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 programmaticall y know whether the spell[/color]
    check[color=blue]
    > had a problem or not.
    >
    > Does anyone know how to get more control over the spell check process in
    > Access?[/color]


    Comment

    • Steve Jorgensen

      #3
      Re: Controlled use of Access spell check possible?

      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_djsteel e@NOSPAM_canada .com> wrote:
      [color=blue]
      >See whether the following helps:
      >
      >Function SpellCheck_Word LB(WordToCheck As String) As Boolean
      >On Error GoTo Err_SpellCheck_ WordLB
      >
      >Dim wd As Object
      >
      > If Len(WordToCheck ) > 0 Then
      > Set wd = CreateObject("W ord.Application ")
      > SpellCheck_Word LB = wd.CheckSpellin g(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[/color]

      Comment

      • Dimitri Furman

        #4
        Re: Controlled use of Access spell check possible?

        On Sep 29 2004, 01:48 pm, Steve Jorgensen <nospam@nospam. nospam> wrote
        in news:c1tll0170n 1hcihif5ku2fd8i feqf99cn1@4ax.c om:

        <snip>[color=blue]
        >
        > 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.RunComman d ... 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 programmaticall y know whether the
        > spell check had a problem or not.[/color]

        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

        Comment

        • Hank Reed

          #5
          Re: Controlled use of Access spell check possible?

          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(Ca lling As Form)

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

          DoCmd.SetWarnin gs False
          Set ctlSpell = Calling.ActiveC ontrol
          If (ctlSpell.Locke d) 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.RunComman d 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

          Comment

          • Steve Jorgensen

            #6
            Re: Controlled use of Access spell check possible?

            Neat - that looks like a good starting point.

            On 30 Sep 2004 02:37:34 -0700, hankrunner@aol. com (Hank Reed) wrote:
            [color=blue]
            >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(Ca lling As Form)
            >
            > Dim ctlSpell As Control
            > Dim Incoming As String, Outgoing As String
            >
            > DoCmd.SetWarnin gs False
            > Set ctlSpell = Calling.ActiveC ontrol
            > If (ctlSpell.Locke d) 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.RunComman d 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[/color]

            Comment

            • Lauren Wilson

              #7
              Re: Controlled use of Access spell check possible?

              On Wed, 29 Sep 2004 22:30:34 GMT, Steve Jorgensen
              <nospam@nospam. nospam> wrote:
              [color=blue]
              >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.[/color]

              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!

              [color=blue]
              >
              >On Wed, 29 Sep 2004 18:06:43 -0400, "Douglas J. Steele"
              ><NOSPAM_djstee le@NOSPAM_canad a.com> wrote:
              >[color=green]
              >>See whether the following helps:
              >>
              >>Function SpellCheck_Word LB(WordToCheck As String) As Boolean
              >>On Error GoTo Err_SpellCheck_ WordLB
              >>
              >>Dim wd As Object
              >>
              >> If Len(WordToCheck ) > 0 Then
              >> Set wd = CreateObject("W ord.Application ")
              >> SpellCheck_Word LB = wd.CheckSpellin g(WordToCheck)
              >> Else
              >> MsgBox "You have to give me a word!"
              >> End If
              >>
              >>End_SpellChec k_WordLB:
              >> If Not wd Is Nothing Then
              >> wd.Quit
              >> Set wd = Nothing
              >> End If
              >> Exit Function
              >>
              >>Err_SpellChec k_WordLB:
              >> MsgBox Err.Description & " (" & Err.Number & ")"
              >> Resume End_SpellCheck_ WordLB
              >>
              >>End Function[/color][/color]

              Comment

              • Steve Jorgensen

                #8
                Re: Controlled use of Access spell check possible?

                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:
                [color=blue]
                >On Wed, 29 Sep 2004 22:30:34 GMT, Steve Jorgensen
                ><nospam@nospam .nospam> wrote:
                >[color=green]
                >>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.[/color]
                >
                >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!
                >
                >[color=green]
                >>
                >>On Wed, 29 Sep 2004 18:06:43 -0400, "Douglas J. Steele"
                >><NOSPAM_djste ele@NOSPAM_cana da.com> wrote:
                >>[color=darkred]
                >>>See whether the following helps:
                >>>
                >>>Function SpellCheck_Word LB(WordToCheck As String) As Boolean
                >>>On Error GoTo Err_SpellCheck_ WordLB
                >>>
                >>>Dim wd As Object
                >>>
                >>> If Len(WordToCheck ) > 0 Then
                >>> Set wd = CreateObject("W ord.Application ")
                >>> SpellCheck_Word LB = wd.CheckSpellin g(WordToCheck)
                >>> Else
                >>> MsgBox "You have to give me a word!"
                >>> End If
                >>>
                >>>End_SpellChe ck_WordLB:
                >>> If Not wd Is Nothing Then
                >>> wd.Quit
                >>> Set wd = Nothing
                >>> End If
                >>> Exit Function
                >>>
                >>>Err_SpellChe ck_WordLB:
                >>> MsgBox Err.Description & " (" & Err.Number & ")"
                >>> Resume End_SpellCheck_ WordLB
                >>>
                >>>End Function[/color][/color][/color]

                Comment

                • David Schofield

                  #9
                  Re: Controlled use of Access spell check possible?

                  On Sat, 02 Oct 2004 03:29:35 -0500, Lauren Wilson <???@???.???> wrote:
                  [color=blue]
                  >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!
                  >
                  >[/color]
                  Hi
                  You're right of course but we get most of our business from companies
                  whose IT departments treat them like this!
                  David

                  Comment

                  Working...