E-Mail Spell Checking Error

philgarside

Board Regular
Joined
Mar 31, 2005
Messages
86
Hi All,

I’ve built a user form that uses this code to send the information they have entered to myself.

Code:
Sub email()

'You must add a reference to the Microsoft outlook Library
    Dim OutApp As Outlook.Application
    Dim OutMail As Outlook.MailItem
    Dim wb As Workbook
    Dim strdate As String
    strdate = Format(Now, "dd-mm-yy h-mm-ss")
    Application.ScreenUpdating = False
    Sheets("Submit Sheet").Copy
    Set wb = ActiveWorkbook
    With wb
        .SaveAs "Part of " & ThisWorkbook.Name _
              & " " & strdate & ".xls"
        Set OutApp = CreateObject("Outlook.Application")
        
        Set OutMail = OutApp.CreateItem(olMailItem)
        With OutMail
            .To = "Phil.Garside@service.britgas.co.uk"
            .CC = ""
            .BCC = ""
            .Subject = "CRA Compliance Check Form SCMO"
            .Body = "Please find attached the submitted case's for the SCMO."
            .Attachments.Add wb.FullName
            'You can add other files also like this
            '.Attachments.Add ("C:\test.txt")
            .Display
            Application.Wait (Now + TimeValue("0:00:02"))
            Application.SendKeys "%S"
            Application.SendKeys "%S"
            Application.Wait (Now + TimeValue("0:00:02"))
        End With
        .ChangeFileAccess xlReadOnly
        Kill .FullName
        .Close False
    End With
    Application.ScreenUpdating = True
    Set OutMail = Nothing
    Set OutApp = Nothing

Unload UserForm1
UserForm1.Hide

Sheets("Submit Sheet").Select
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("A1").Select
Sheets("Cover").Select

End Sub

The problem I have is that I don’t want the user to have to click anything. E.g. send, and this code work fine for that. The issue I have is that some of my users have auto spell checker set up in outlook so abbreviations pop up as incorrect spelling. This means that they have to spell check the e-mail before it sends. Dose anyone know of any code that will ignore any spell checking suggestions?

Thanks for your help,

Phil
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi Phil,

I did some searching and I believe that disabling the spell checker in a VBA routine like this is not possible. There is no spell checking object or property in the Outlook object model, it appears to be controlled by a registry setting. Even if your VBA modified the registry setting it might require an exit and restart of Outlook for the change to take effect.

However, there is possibly a good workaround. There is a pretty comprehensive set of examples for sending email from Excel on this site:

http://www.rondebruin.nl/sendmail.htm

Check out the CDO examples. This will bypass Outlook entirely, and you should still be able to accomplish what you need.
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,917
Members
449,055
Latest member
KB13

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top