Hallo zusammen
Ich habe folgendes Problem: Ich möchte eine Word Datei in Outlook als .dotm versenden. Folgenden Code konnte ich bisher erstellen mit Hilfe vom Internet. Leider klappt es aber nicht mit der Versendung als .dotm. Wer kann mir da weiterhelfen?
Private Sub Versendung_Mail_Click()
Dim xOutlookObj As Object
Dim xEmail As Object
Dim xDoc As Document
Dim Pfad, Datei
Application.ScreenUpdating = False
Set xOutlookObj = CreateObject("Outlook.Application")
Set xEmail = xOutlookObj.CreateItem(olMailItem)
Set xDoc = ActiveDocument
xDoc.SaveAs ("Reservationsanfrage"), FileFormat = (".dotm")
With xEmail
.Subject = "Anfrage"
.To = "logistik@......"
.Importance = olImportanceNormal
.Attachments.Add xDoc.FullName
.Display
End With
Set xDoc = Nothing
Set xEmail = Nothing
Set xOutlookObj = Nothing
Application.ScreenUpdating = True
Word.ActiveDocument.Saved = True ' Flag für Änderungen zurücksetzen
Word.NormalTemplate.Saved = True
Word.Application.Quit savechanges:=wdDoNotSaveChanges
End Sub