none
Do not check spelling or grammar RRS feed

  • Question

  • The spelling of the outlook does not work within the firm and I created a macro to clear the "Do not check spelling or grammar". But now I want to run it instead of me manually run automatically when you create a new message or reply

    Private Sub Application_Startup()
    ' Check for an open email message ' Updated for Outlook 2010 on 11/1/11
    If Inspectors.Count = 0 Then Exit Sub
    If ActiveInspector.CurrentItem.Class <> olMail Then Exit Sub
    ' Iterate through the paragraphs and set the noproofing property to false
    Dim wdEd As Object, intCount As Integer, par As Object
    Set wdEd = ActiveInspector.WordEditor
    For intCount = 1 To wdEd.Paragraphs.Count
        Set par = wdEd.Paragraphs.Item(intCount).Range
        If Len(par.Text) > 4 Then
            ' Try to skip any forwarded or replied-to message
            If LCase(Left(par.Text, 6)) = "from: " Then Exit For
            ' Otherwise, remove the immunity to spell checking
            par.noproofing = False
        End If
    Next
    ' Report and clean up
    Debug.Print "Examined: " & intCount & " of " & wdEd.Paragraphs.Count
    Set wdEd = Nothing
    End Sub
    

    Friday, March 15, 2013 12:19 PM

Answers

  • You cannot use multiple threads in VBA.  Also, using the Outlook Object Model in additional threads is not supported.

    Otherwise, I'm having a very hard time understanding your English.  If you want to use code to pick a stationery theme, I don't see support for that.  You may want to use custom forms instead or review the tools here:

    HTML Stationery for Outlook - Slipstick Systems
    http://www.slipstick.com/addins/mail-tools/html-stationery-for-outlook/


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Thursday, March 21, 2013 4:22 PM
    Moderator
  • The Outlook Object Model doesn't contain any methods for controlling spelling.  That's all handled by the Word Object Model.  If you want to try automating the spelling features of Word, I suggest posting in the Word for Developers forum.

    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Monday, March 18, 2013 5:27 PM
    Moderator

All replies

  • That code is in the Application_Startup event, which as you probably discovered doesn't work because it doesn't give the user any time to create a new email.  You'll have to trap the Inspectors.NewInspector event, which will also fire for replies.

    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Friday, March 15, 2013 1:58 PM
    Moderator
  • Thanks I will try and tell you
    Friday, March 15, 2013 3:31 PM
  • if I call the function from the inspector fails me

    Dim WithEvents colInsp As Outlook.Inspectors
    
    
    
    Private Sub Application_Startup()
        Set colInsp = Application.Inspectors
    End Sub
    
    
    Private Sub colInsp_NewInspector(ByVal Inspector As Inspector)
    
    prueba
    End Sub
    
    
    
    Private Sub prueba()
     Dim wordEditor As Object
     
        If Inspectors.Count = 0 Then Exit Sub
        If Application.ActiveInspector.CurrentItem.Class <> olMail Then Exit Sub
        If Not ActiveInspector.IsWordMail Then Exit Sub
        If ActiveInspector.EditorType <> olEditorWord Then Exit Sub
        Set wordEditor = ActiveInspector.wordEditor
     
        On Error Resume Next
        ActiveInspector.wordEditor.Styles("Normal").LanguageID = ALangID
        ActiveInspector.wordEditor.SpellingChecked = False
    End Sub
    

    Monday, March 18, 2013 10:09 AM
  • When I run your code with Option Explicit enabled in the module, it fails to compile because you don't have a variable declared for ALangID, nor a value specified for it.  When I add that and set it to 1033 it runs without error.  However, the default is already 1033 and SpellingChecked is already false.

    I believe that you can't turn spell check on/off on the fly.  You have to set a registry value (HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Options\Spelling) and restart Outlook for the changes to take effect.


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Monday, March 18, 2013 3:18 PM
    Moderator
  • Can you give an example? (HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 14.0 \ Outlook \ Options \ Spelling) was at 0, and change it to 1, but did not notice the changes.
    Monday, March 18, 2013 4:40 PM
  • You have to restart Outlook for the changes to take effect.

    If you are looking for code to edit the registry, there's plenty of examples on the Internet, but you'd have to use the Win32 API as there's no registry support in the Outlook Object Model or VBA.


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Monday, March 18, 2013 4:52 PM
    Moderator
  • This option only thing it does is check the "Always check spelling before sending". Not worth it because I still can not check the spelling of what I write in my signature and that is why I want to create the macro

    Monday, March 18, 2013 5:22 PM
  • The Outlook Object Model doesn't contain any methods for controlling spelling.  That's all handled by the Word Object Model.  If you want to try automating the spelling features of Word, I suggest posting in the Word for Developers forum.

    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Monday, March 18, 2013 5:27 PM
    Moderator
  • If running the macro manually is achieved, I imagine it will also be done automatically. Can you stop waiting a function running in the background? If I can make the function wait to run until the mail was opened I think it would work
    Wednesday, March 20, 2013 10:49 AM
  • I don't know if you can turn off/on spell check on the fly in the Word Object Model, independent of Outlook's settings.  If it's settings-based and stored in the registry, you have to restart Outlook for the changes to take effect.

    I don't understand your background question - can you rephrase please?


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Wednesday, March 20, 2013 2:13 PM
    Moderator
  • I have I already activated. If I write outside the firm successfully corrects the problem within the firm does not correct the default and that is not in the record.

    The question was: Is it possible to run a macro in the background?
     

    If instead of a signature put a stationery staff if it corrects, but the design of personal background does not work in the responses,

    Is there any way to use the stationery staff for answers?


    Thursday, March 21, 2013 3:54 PM
  • You cannot use multiple threads in VBA.  Also, using the Outlook Object Model in additional threads is not supported.

    Otherwise, I'm having a very hard time understanding your English.  If you want to use code to pick a stationery theme, I don't see support for that.  You may want to use custom forms instead or review the tools here:

    HTML Stationery for Outlook - Slipstick Systems
    http://www.slipstick.com/addins/mail-tools/html-stationery-for-outlook/


    Eric Legault MVP (Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

    Thursday, March 21, 2013 4:22 PM
    Moderator