Hier das Makro:
-> Problem in Orange
..oder liegt ggf. das Problem im Script auf das das Makro zugreift?
--------------------------------------------------------------------------------------------
Option Explicit
Sub Mail_Only_Text()
'Ron de Bruin : 20-Feb-2021
'Mail only text example
'Do not forget to add the custom functions into your own workbook
'More Mail codes : https://macexcel.com/examples/mailpdf/macoutlook/
Dim strbody As String
'Create the body text in the strbody string
'The first and last line are used to set the font and font size
strbody = "<FONT size=""3"" face=""Calibri"">"
strbody = strbody & "Hi there" & "<br>" & "<br>" & _
"This is line 1" & "<br>" & _
"This is line 2" & "<br>" & _
"This is line 3" & "<br>" & _
"This is line 4"
strbody = strbody & "</FONT>"
'Call the MailWithMacOutlookFunction to create the mail
'When you use more mail addresses separate them with a ,
'Change yes to no or leave it empty in the displaymail argument to send directly
'Look in Outlook>Preferences for the account 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 "exchange", "pop" or "imap"
'Note: It will use the signature of the account that you choose
'attchment is used for one file and you can use otherattachments to add other existing files like
'otherattachments:="/Users/rondebruin/Desktop/Summary code.xlsm"
'When you use more mail file path's in otherattachments separate them with a ,
MailWithMacOutlookFunction _
subject:="This is a test macro", _
mailbody:=strbody, _
toaddress:="ron@debruin.nl", _
ccaddress:="", _
bccaddress:="", _
displaymail:="yes", _
accounttype:="", _
accountname:="", _
attachment:="", _
otherattachments:=""
End Sub
-------------------------------------------------------------------------------------------------------------------------------------------
Function MailWithMacOutlookFunction(subject As String, mailbody As String, _
toaddress As String, ccaddress As String, _
bccaddress As String, displaymail As String, _
accounttype As String, accountname As String, _
attachment As String, otherattachments As String)
' https://macexcel.com/examples/mailpdf/macoutlook/
' Ron de Bruin : 20-Feb-2021
Dim ScriptStr As String, RunMyScript As String
'Build the AppleScriptTask parameter string
ScriptStr = subject & ";" & mailbody & ";" & toaddress & ";" & ccaddress & ";" & _
bccaddress & ";" & displaymail & ";" & accounttype & ";" & _
accountname & ";" & attachment & ";" & otherattachments
'Call the RDBMacOutlook(2).scpt script file with the AppleScriptTask function
RunMyScript = AppleScriptTask("RDBMacOutlook(2).scpt", "CreateMailInOutlook", CStr(ScriptStr))
End Function
|