Results 1 to 6 of 6

Thread: Disable OUTLOOK spellcheck using VBA

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    Rep Power
    0

    Disable OUTLOOK spellcheck using VBA

    Hi,

    I have been trying this with no success.

    Could any 1 please help me with Disabling the OUTLOOK Spellcheck using Excel VBA. The problem here is that the Macros for OUTLOOK have been diabled by the ADMIN here.

    Regards
    Varun Dandona

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi Varun,

    Welcome to ExcelFox !!

    Couldn't you disable the spell checking via Tools > Options > Spelling and uncheck 'Always check spelling before sending' ?
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Junior Member
    Join Date
    Sep 2011
    Posts
    2
    Rep Power
    0
    Hi Admin,

    I have made a tool where user can send query to me. So cant go to each and every user and do the above process. I want it to be done automatically through a VBA CODE. eg. using some application.sendkeys or something else.

    Regards
    Varun

  4. #4
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi Varun,

    In a standard module

    Code:
    '// Original code from  : http://vba-corner.livejournal.com/3054.html
    'reads the value for the registry key i_RegKey
    'if the key cannot be found, the return value is ""
    Function RegKeyRead(i_RegKey As String) As String
        
        Dim myWS As Object
    
        On Error Resume Next
        'access Windows scripting
        Set myWS = CreateObject("WScript.Shell")
        'read key from registry
        RegKeyRead = myWS.RegRead(i_RegKey)
    
    End Function
    Function RegKeyExists(i_RegKey As String) As Boolean
        
        Dim myWS As Object
    
        On Error GoTo ErrorHandler
        'access Windows scripting
        Set myWS = CreateObject("WScript.Shell")
        'try to read the registry key
        myWS.RegRead i_RegKey
        'key was found
        RegKeyExists = True
        Exit Function
        
    ErrorHandler:
        'key was not found
        RegKeyExists = False
    
    End Function
    
    'Saving a Registry key:
    'sets the registry key i_RegKey to the
    'value i_Value with type i_Type
    'if i_Type is omitted, the value will be saved as string
    'if i_RegKey wasn't found, a new registry key will be created
    Sub RegKeySave(i_RegKey As String, i_Value As String, _
                        Optional i_Type As String = "REG_SZ")
        
        Dim myWS As Object
        
        'access Windows scripting
        Set myWS = CreateObject("WScript.Shell")
        'write registry key
        myWS.RegWrite i_RegKey, i_Value, i_Type
    
    End Sub
    
    'Deleting a key from the Registry:
    'deletes i_RegKey from the registry
    'returns True if the deletion was successful,
    'and False if not (the key couldn't be found)
    Function RegKeyDelete(i_RegKey As String) As Boolean
        
        Dim myWS As Object
    
        On Error GoTo ErrorHandler
        'access Windows scripting
        Set myWS = CreateObject("WScript.Shell")
        'delete registry key
        myWS.RegDelete i_RegKey
        'deletion was successful
        RegKeyDelete = True
        Exit Function
        
    ErrorHandler:
        'deletion wasn't successful
        RegKeyDelete = False
    
    End Function
    Again in a standard module. (Better to insert new one)

    Code:
    'HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Options\Spelling\Check"
    '0 = disabled
    '1 = enabled
    
    Sub DisableSpellCheckRegistryChange()
        
        Dim strRegKey   As String
        Dim strValue    As String
        Dim strAnswer   As Long
        
        'MS Outlook 2007
        strRegKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Options\Spelling\Check"
        
        'check if key exists
        If RegKeyExists(strRegKey) = True Then
            If RegKeyRead(strRegKey) = 1 Then
                RegKeySave strRegKey, 0
            End If
        Else
            MsgBox "Unable to edit the Registry", vbInformation
        End If
    
    End Sub
    HTH
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  5. #5
    Junior Member coldbeersoldhere's Avatar
    Join Date
    Oct 2011
    Posts
    1
    Rep Power
    0

    Hi There

    Do we have any option other than tampering the registry. The reason for that is:
    Sometimes because of group policies applied on the computer it impossible to change anything in the registry.
    It will give any error "Permission Denied"

    Regards
    Gurpreet Singh
    Cheers
    Gurpreet Singh

  6. #6
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi Gurpreet,

    Welcome to ExcelFox !!!

    Unfortunately I'm not aware of any other method
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Replies: 5
    Last Post: 06-11-2013, 08:15 PM
  2. Replies: 6
    Last Post: 05-25-2013, 07:36 PM
  3. Replies: 1
    Last Post: 05-22-2013, 01:50 PM
  4. How To Send Outlook Email Using VBA
    By mfaisalrazzak in forum Excel Help
    Replies: 7
    Last Post: 03-03-2013, 03:09 AM
  5. VBA - Excel: Disable Internet / Google
    By technicalupload in forum Excel Help
    Replies: 3
    Last Post: 10-06-2011, 09:18 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •