How to emulate the "Sendkeys" Excel function in MS Access RRS feed

  • Question

  • I have the following code which is from Excel.  I'm converting an excel app to Access.  I'm focusing on the SendKeys method call at the bottom.  What it does in Excel is to send the email and close out the Thunderbird mail program.  Though all of thise code runs in Access untouched, the SendKeys line does not send the email.

    Wonder what I can supplant in there to accomplish the task.  Thanks.

    Sub sendemail()

        Dim tbird, towho, subject, body As String
        tbird = "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe "
        towho = "to='xxxxxx@gmail.com',"
        subject = "subject='This part needs a print',"
        body = "body=WT " & emailwt & " Part Number " & emailid
        Call Shell(tbird & "-compose " & """" & towho & subject & body & """", 1)
        'Application.Wait (Now + TimeValue("0:00:04"))
        SendKeys "^{ENTER}", True
    End Sub

    Thanks, David

    Wednesday, November 28, 2018 3:06 PM


All replies