简体   繁体   中英

Create new mail on Mac using Excel VBA

I need to adjust my macro described below that it runs on mac with using Apple Mail application.

Sub SendMail()

    Dim OutlookApp As Object: Set OutlookApp = CreateObject("Outlook.Application")
    Dim var As Variant: var = Selection.Value
    Set MyMail = OutlookApp.CreateItem(0)
    With MyMail
        .To = var(1, 8)
        .Subject = "Skuska"
        .body = "Dobry den...bla bla bla" & vbNewLine & vbNewLine & var(1, 2) & vbNewLine & var(1, 3) & vbNewLine & var(1, 5) & "  " & var(1, 4) & vbNewLine & vbNewLine & "Tel.c.:" & vbNewLine & var(1, 6) & vbNewLine & var(1, 7) & vbNewLine & vbNewLine & var(1, 9) & vbNewLine & vbNewLine & "S pozdravom" & vbNewLine & "Meno" & vbNewLine & "Tel."
        .sent
    End With
End Sub

This macro run with Outlook but I´m using Apple Mail.

Outlook for Mac 2011 (nor Apple Mail) does not support VBA. As far as I know automation of Outlook for Mac or Apple Mail can be accomplished using Applescript and/or Automator. See Introduction to Scripting Mail for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM