AW: Nein - Du musst die...
02.12.2016 15:28:17
Jamie
*klatschinsGesicht*
habe den Fehler gefunden, ich habe Mac Excel 2016 nicht 2011...
Hierbei musste ich diese Anleitung fahren:
http://www.rondebruin.nl/mac/macmail/macoutlook2016.htm
Jetzt hat mich aber das Ganze auf eine super Idee gebracht.
Wie kann ich bestimmte Zellen Inhalt vom Excel im Bodytext (E-Mail) Wiederspiegeln?
Mein jetziger Code ist:
Sub Mail_WorkSheet_or_Worksheets_in_Mac_Excel_2016_with_Outlook3()
'Only working in Excel 2016 for the Mac with Outlook 2016 as mail program
'Do not forget to add the 3 functions into your own workbook
'More Mail codes : http://www.rondebruin.nl/mac/ _
mail.htm
Dim Sourcewb As Workbook, DestWB As Workbook, sh As Worksheet
Dim strbody As String, TempFileName As String
'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, " & _
"Visit http://www.rondebruin. _
nl/mac/macmail/macoutlook2016.htm
for more information."
Exit Sub
End If
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
'Set reference to the source workbook
Set Sourcewb = ActiveWorkbook
'Create the body text in the strbody string
'The first and last line are used to set the font and font size
strbody = ""
strbody = strbody & "Hi there" & "
" & "
" & _
"This is line 1" & "
" & _
"This is line 2" & "
" & _
"This is line 3" & "
" & _
"This is line 4"
strbody = strbody & ""
'Copy the ActiveSheet to a new workbook, you can also use : Sourcewb.Sheets("MySheetName"). _
Copy
'Or for more sheets : Sourcewb.Sheets(Array("Sheet1", "Sheet3")).Copy
ActiveSheet.Copy
Set DestWB = ActiveWorkbook
'Delete the button on the one sheet workbook
On Error Resume Next
DestWB.Sheets(1).DrawingObjects.Visible = True
DestWB.Sheets(1).DrawingObjects.Delete
On Error GoTo 0
'Change all cells in the worksheets to values if you want
'I use .Value = .Value because PasteSpecial with CutCopyMode = False not work on a Mac
'For Each sh In DestWB.Worksheets
'With sh.UsedRange
'.Value = .Value
'End With
'Next sh
'Enter the name of the file we just create
TempFileName = "Part of " & Sourcewb.Name & " " _
& Format(Now, "dd-mmm-yy h-mm-ss")
'Call the MailWithMacOutlook2016 function to save the new file and create the mail
'When you use more mail addresses separate them with a ,
'Look in Outlook>Preferences for the type and name of the account 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
MailWithMacOutlook2016WorkSheet _
subject:="This is a test macro", _
mailbody:=strbody, _
toaddress:="ron@debruin.nl", _
ccaddress:="", _
bccaddress:="", _
displaymail:=True, _
accounttype:="", _
accountname:="", _
attachment:=TempFileName, _
FileFormat:=Sourcewb.FileFormat
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub