'command Button 1 - speichern
Private Sub CommandButton2_Click()
Dim xOutlookObj As Object
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
Dim rng As Range
Dim strmsg As String
Dim arrymsg()
Dim i As Long
Dim strDesktopPath As String
On Error Resume Next
If IsEmpty(Range("A7")) Then
MsgBox "Enter date"
GoTo ends
Else
If IsEmpty(Range("D7")) Then
MsgBox "Enter Vizrt sales peson"
GoTo ends
Else
If IsEmpty(Range("C9")) Then
MsgBox "Enter the start date of your rental"
GoTo ends
Else
If IsEmpty(Range("C11")) Then
MsgBox "Enter the end date of your rental"
GoTo ends
Else
If IsEmpty(Range("A15")) Then
MsgBox "Please enter a subject line / quote number in cell A15!"
GoTo ends
End If
End If
End If
End If
End If
Dim Name
Name = Application.GetSaveAsFilename("C:\Testpfad\" & Range("A15") & ".xlsm", fileFilter:="Microsoft Excel-Arbeitsmappe (*.xlsm), *.xlsm")
If Name <> False Then
ActiveWorkbook.SaveAs Name, FileFormat:= _
xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
End If
ends:
End Sub
'Command Button
Private Sub CommandButton1_Click()
Dim xOutlookObj As Object
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
Dim rng As Range
Dim strmsg As String
Dim arrymsg()
Dim i As Long
Dim strDesktopPath As String
On Error Resume Next
If IsEmpty(Range("A7")) Then
MsgBox "Enter date"
GoTo ends
Else
If IsEmpty(Range("D7")) Then
MsgBox "Enter Vizrt sales peson"
GoTo ends
Else
If IsEmpty(Range("C9")) Then
MsgBox "Enter the start date of your rental"
GoTo ends
Else
If IsEmpty(Range("C11")) Then
MsgBox "Enter the end date of your rental"
GoTo ends
Else
If IsEmpty(Range("A15")) Then
MsgBox "Please enter a subject line / quote number in cell A15!"
GoTo ends
End If
End If
End If
End If
End If
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.createitem(0)
Doc.SaveAs2 Filename:=Environ("temp") & "\" & Environ("username"), FileFormat:=wdFormatPDF, AddToRecentFiles:=False
xMailBody = "Please add any special requirements hereFor FOC rentals - please attach Vanessa's approval to your email." & vbNewLine & vbNewLine & _
"" & vbNewLine & _
""
On Error Resume Next
With xOutMail
.To = "logisticaustria@vizrt.com"
.CC = ""
.BCC = ""
.Subject = "Demopool Request Form_"
.Body = xMailBody
.Attachments.Add ActiveWorkbook.FullName
.Display 'or use .Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
ends:
End Sub