ich möchte die Schriftgrösse der Mail auf 15 stellen.
Es hat heute funktioniert und jetzt geht es nicht mehr ?
Hier ist mein Code. Was mache ich nur falsch ?
Option Explicit
Private Declare PtrSafe
Function apiCreateFullPath Lib "imagehlp.dll" Alias "MakeSureDirectoryPathExists" (ByVal lpPath _
As String) As Long
Sub Datenblatt_senden_nr3_2122015()
Dim olApp As Object
Dim strPfad As String
Dim strName As String
Dim olOldbody As String
Dim wdApp As Object
Dim wdDoc As Object
Dim wdRange As Object
Dim olNewBody As String
Dim lngZelle As Long
apiCreateFullPath (Environ("USERPROFILE") & "\Documents\_excelexporttmp\")
strPfad = Environ("USERPROFILE") & "\Documents\_excelexporttmp\"
strName = "export.xls"
Worksheets("Datenblatt").Copy
Application.DisplayAlerts = False
With ActiveWorkbook
.SaveAs strPfad & strName, FileFormat:=xlWorkbookNormal
.Close
End With
Application.DisplayAlerts = True
Set olApp = CreateObject("Outlook.Application")
With olApp.CreateItem(0)
.GetInspector.Display
olOldbody = .htmlBody
.To = "roebe@arcor.de"
.CC = "roebe@arcor.de"
.Subject = "Anforderung Übungsmaterial für den Unterricht - Schueler: " & Worksheets(" _
Datenblatt").Range("B21").Value & ", " & Worksheets("Datenblatt").Range("D21").Value
.htmlBody = "Hallo,
wir benötigen Übungsmaterial für o. g. Schüler/in.
" _
& _
"Mit freundlichen Grüßen
Studienkreis Essen Rüttenscheid
S. _
Birkel " & _
"
" & olOldbody
.Attachments.Add strPfad & strName
.Save
Rem Word-Editor-Objekt erstellen (zum Formatieren erforderlich)
Set wdApp = .GetInspector
Set wdDoc = wdApp.WordEditor
Set wdRange = wdDoc.Range
wdRange.WholeStory
Rem Emailtext formatieren
With wdRange
Rem Schriftart und Schriftgröße festlegen
.Font.Name = "Arial"
.Font.Size = 15
End With
End With
Rem Objekte freigeben
Set wdRange = Nothing
Set wdDoc = Nothing
Set wdApp = Nothing
Set olApp = Nothing
End Sub