Disable spell check in Louts Notes when sending emails via excel

Discussion in 'Lotus Notes Programming' started by Amit, Oct 31, 2017.

  1. Amit

    Amit New Member

    Joined:
    Oct 31, 2017
    Messages:
    1
    Likes Received:
    0
    Hi,

    I have a VBA code to send multiple email through lotus notes using excel macro, but while sending email, lotus notes use spell check which i want to disable. Can anyone advice me how to disable spell check in louts notes.

    I am using lotus notes 9

    Thanks in advance.

    Amit.
     
    Amit, Oct 31, 2017
    #1
    1. Advertisements

  2. Amit

    Syrkrasi New Member

    Joined:
    Nov 15, 2017
    Messages:
    2
    Likes Received:
    1
    Syrkrasi, Nov 15, 2017
    #2
    1. Advertisements

  3. Amit

    Syrkrasi New Member

    Joined:
    Nov 15, 2017
    Messages:
    2
    Likes Received:
    1
    Add Spellchk to the list of Dim As Object
    Code:
        Dim ws, uidoc, session, db, uidb, NotesAttach, NotesDoc, objShell, Spellchk As Object
    Add the following code before: Call uidoc.SEND
    Code:
    'ByPass Spell Check
       Set Spellchk = db.GetProfileDocument("CalendarProfile")
         Spellchk.SpellCheck = ""
        Call Spellchk.Save(False, True)
    Here is the completed (and tested) code
    Code:
    Public TOID As String
    Public CCID As String
    Public SECT As String
    Public ACCO As String
    Public SUBJ As String
    Sub Apollo()
    
    Dim answer As Integer
    answer = MsgBox("DO YOU HAVE LOTUS NOTES OPEN ?? Not WebLotus notes", vbYesNo + vbQuestion, "LOTUS NOTES")
    If answer = vbNo Then
    MsgBox "Please Open Notes and Try the Macro Again"
    Exit Sub
    Else
    End If
    
    Application.DisplayAlerts = False
    Call Athena
    
    MsgBox "Mail Sent to " & (Range("L2").Value) & " " & "Recipents"
    
    Application.DisplayAlerts = True
    End Sub
    
    Public Function Athena()
    
    SendEMail = True
    
    Sheets("Main").Select
    TOID = Range("A7").Value
    CCID = ""
    SUBJ = Range("B7").Value
    
    'On Error GoTo ErrorMsg
    
    Dim EmailList As Variant
    Dim ws, uidoc, session, db, uidb, NotesAttach, NotesDoc, objShell, Spellchk As Object
    Dim RichTextBody, RichTextAttachment As Object
    Dim server, mailfile, user, usersig As String
    Dim SubjectTxt, MsgTxt As String
    
    Set session = CreateObject("Notes.NotesSession")
    
    Application.Wait (Now + TimeValue("0:00:01"))
    user = session.UserName
    usersig = session.COMMONUSERNAME
    mailfile = session.GETENVIRONMENTSTRING("MailFile", True)
    server = session.GETENVIRONMENTSTRING("MailServer", True)
    
    Set db = session.GETDATABASE(server, mailfile)
    If Not db.IsOpen Then
    Call db.Open("", "")
    Exit Function
    End If
    
    Set NotesDoc = db.CReateDocument
    
    With NotesDoc
    .form = "Memo"
    .Subject = SUBJ 'The subject line in the email
    .Principal = user
    .SendTo = TOID 'e-mail ID variable to identify whom email need to be sent
    .CopyTo = CCID
    End With
    
    Application.Wait (Now + TimeValue("0:00:01"))
    Set RichTextBody = NotesDoc.CreateRichTextItem("Body")
    
    With NotesDoc
    .COMPUTEWITHFORM False, False
    End With
    
    'Now set the front end stuff
    Set ws = CreateObject("Notes.NotesUIWorkspace")
    If Not ws Is Nothing Then
    Set uidoc = ws.EDITDOCUMENT(True, NotesDoc)
    
    If Not uidoc Is Nothing Then
    If uidoc.EDITMODE Then
    
    Sheets("Main").Select
    Range("C7").Select
    Dim rnBody1 As Range
    Set rnBody1 = Selection
    'rnBody1.CopyPicture
    rnBody1.Copy
    Call uidoc.Gotofield("Body")
    Call uidoc.Paste
    
    End If
    End If
    End If
    
    Application.Wait (Now + TimeValue("0:00:01"))
    
    'ByPass Spell Check
    Set Spellchk = db.GetProfileDocument("CalendarProfile")
    Spellchk.SpellCheck = ""
    Call Spellchk.Save(False, True)
    
    Call uidoc.SEND
    Call uidoc.Close
    
    
    Application.Wait (Now + TimeValue("0:00:01"))
    
    'close connection to free memory
    Set session = Nothing
    Set db = Nothing
    Set NotesAttach = Nothing
    Set NotesDoc = Nothing
    Set uidoc = Nothing
    Set ws = Nothing
    
    Sheets("Main").Select
    Application.Wait (Now + TimeValue("0:00:01"))
    
    End Function
     

    Attached Files:

    Syrkrasi, Dec 13, 2017
    #3
    Ian likes this.
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.