• Spell Check on controls (AXP)

    Author
    Topic
    #395778

    I know there is a way, but it the right way that I am after!

    How can I do a spell check on a form control? Also, are there any options one can due during the spell check, like auto replace, suggest replacement, etc?

    Thanks,
    Mark

    Viewing 1 reply thread
    Author
    Replies
    • #737092

      Interactively, press F7 or select Tools | Spellling… while the insertion point is in a control that contains text. You can set various options in the Spelling tab of Tools | Options…

      You can invoke the spell checker in code using RunCommand acCmdSpelling. It is wise to add error handling in case spell checking is not possible.

      Note: a combo box may display text, but still be bound to a numeric field; it doesn’t count as text then!

      • #737094

        Great! Is there a way to make it so that it only runs on the control in question? It seems that it wants to run on everything that is open.

        Thanks,
        Mark

        • #737105

          You could create a command button cmdSpell with the following On Click code:

          Private Sub cmdSpell_Click()
          On Errror GoTo ErrHandler
          With Screen.PreviousControl
          .SetFocus
          .SelStart = 0
          .SelLength = Len(.Text)
          End With
          RunCommand acCmdSpelling
          Exit Sub
          ErrHandler:
          ‘ Just get out
          End Sub

          By selecting the text within the control, you limit spell checking to that control

          • #737109

            That will work!

            Thanks Hans!

          • #737110

            That will work!

            Thanks Hans!

          • #737148

            This works great. However, is there a way to make it work silently in the background? When it runs, it gives a dialog that says it has completed running. I would like for the user not to have to make another click if I can avoid it.

            Thanks,
            Mark

            • #737154

              Short of buying a third-party spell checker add-in (such as Total Access Speller from FMS, website seems to be down at the moment) or writing your own spell checking routines evilgrin, I don’t think that is possible.

            • #1144128

              I’ve just found out that pressing F7 doesn’t work if you open the mdb using the 2003 RunTime. Is there a workaround?

            • #1144129

              The runtime version of Access does not include proofing tools.

              If the PC with the runtime version does have Microsoft Word installed, you could use code to load an invisible instance of Word and let it perform the spell check. That obviously won’t work on PCs that don’t have MS Office at all.

            • #1144130

              Thank you Hans, can you provide an example of such code?

            • #1144131

              Sorry, I haven’t tried this myself (I don’t use Access Runtime).

            • #1145685

              I’ve made it work by putting a Spell Check command button on the main form whose code first sets the focus on the continuous subform and then runs the spell check but I can’t figure out how to give the focus back to the main form once the spell check is done so that the upper part of the main form window comes back into view.

            • #1145688

              You have to set focus to a control in the main form, e.g.

              Me.CmbDaEvadere.SetFocus

            • #1145693

              Thank you Hans, I’ve added a transparent text box to the top left of the main form.

            • #737155

              Short of buying a third-party spell checker add-in (such as Total Access Speller from FMS, website seems to be down at the moment) or writing your own spell checking routines evilgrin, I don’t think that is possible.

          • #737149

            This works great. However, is there a way to make it work silently in the background? When it runs, it gives a dialog that says it has completed running. I would like for the user not to have to make another click if I can avoid it.

            Thanks,
            Mark

        • #737106

          You could create a command button cmdSpell with the following On Click code:

          Private Sub cmdSpell_Click()
          On Errror GoTo ErrHandler
          With Screen.PreviousControl
          .SetFocus
          .SelStart = 0
          .SelLength = Len(.Text)
          End With
          RunCommand acCmdSpelling
          Exit Sub
          ErrHandler:
          ‘ Just get out
          End Sub

          By selecting the text within the control, you limit spell checking to that control

      • #737095

        Great! Is there a way to make it so that it only runs on the control in question? It seems that it wants to run on everything that is open.

        Thanks,
        Mark

    • #737093

      Interactively, press F7 or select Tools | Spellling… while the insertion point is in a control that contains text. You can set various options in the Spelling tab of Tools | Options…

      You can invoke the spell checker in code using RunCommand acCmdSpelling. It is wise to add error handling in case spell checking is not possible.

      Note: a combo box may display text, but still be bound to a numeric field; it doesn’t count as text then!

    Viewing 1 reply thread
    Reply To: Spell Check on controls (AXP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: