VBA | Отправить диапазон на электронную почту в формате PNG / JPEG - MacOS - PullRequest
0 голосов
/ 16 января 2020

Я работал над этим сценарием с https://www.rondebruin.nl/mac/mail.htm, чтобы попытаться вывести JPEG / PNG из диапазона выбора. В настоящее время он выводит на электронную почту только код HTML, поэтому изображения и формы теряются.

Кто-нибудь знает, как это работает? Конкретно мне это нужно для работы на MacBook. У меня есть windows версия, которая работает хорошо, но код (в c. Библиотеках) становится более громоздким в Ma c.

Option Explicit

Sub CommandButton1_Click()
    Dim strbody As String
    Dim HTMLMac As String

    'Exit the sub if it is Mac Excel 2011 or lower
    If Val(Application.Version) < 15 Then Exit Sub

    'Check if the AppleScriptTaskExcelScriptFile is in the correct location
    If CheckAppleScriptTaskExcelScriptFile(ScriptFileName:="RDBMacOutlook.scpt") = False Then
        MsgBox "Sorry the RDBMacOutlook.scpt file is not in the correct location" _

        Exit Sub
    End If

    With Application
        .ScreenUpdating = False
        .EnableEvents = False
    End With

    'Create the htm file and read the html code in the string
    HTMLMac = RangetoHTMLMac(ActiveSheet.Range("D21:L62"))

    'Call the MailWithMacOutlook2016Body function to create the mail
    'When you use more mail addresses separate them with a ,
    'Change yes to no in the displaymail argument to send directly
    'Look in Outlook>Preferences for the type and name of the account that you want to use
    'If accounttype is empty it will use the default mail account, accounttype can be pop or imap
    'Note: It will use the signature of the account that you choose
    MailWithMacOutlook2016Body _
    subject:="Report " & Date, _
    mailbody:=HTMLMac, _
    toaddress:="na@na.com", _
    ccaddress:="", _
    bccaddress:="", _
    displaymail:="yes", _
    accounttype:="", _
    accountname:=""

    With Application
        .ScreenUpdating = True
        .EnableEvents = True
    End With
End Sub

Спасибо!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...