Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-17-2018, 09:32 PM
Guessed's Avatar
Guessed Guessed is offline Spell Check TextBox in UserForm Windows 10 Spell Check TextBox in UserForm Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default


Try it with a couple of little changes
Code:
Option Explicit
Private Sub cmdSpellCheck_Click()
    DoSpellCheck TextBox1
    MsgBox "Spelling and Grammar Check Complete"
lbl_Exit:
    Exit Sub
End Sub

Public Sub DoSpellCheck(oTxtBox As Control)
Dim oDoc2 As Document, oRng As Range
    With oTxtBox
        If Not .value = "" And Not .value = "<WhatEver>" Then
            Set oDoc2 = Documents.Add
            Set oRng = oDoc2.Range
            oRng = .value
            With oRng
                .SpellingChecked = False
                .CheckSpelling AlwaysSuggest:=True
                .CheckGrammar
                .End = .End - 1
            End With
            'Return data to the Userform
            .value = oRng.Text
            oDoc2.Saved = True
            oDoc2.Close SaveChanges:=wdDoNotSaveChanges
            Set oDoc2 = Nothing
        End If
    End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell Check TextBox in UserForm UserForm textbox exit event activated with navigation buttons...why? help? orozvik@yahoo.com Excel Programming 2 05-08-2015 02:50 AM
Can't use RTF Textbox in Userform (Word2007) dherr Word VBA 2 03-16-2015 07:50 AM
Spell Check TextBox in UserForm Userform VBA Textbox Calculation MarkAn Word VBA 2 08-15-2014 06:50 AM
Spell Check TextBox in UserForm Number format in Textbox on userform officeclerk Excel Programming 2 04-17-2012 01:23 AM
Spell Check WorkerB Word 2 11-21-2009 07:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft