У меня есть VBA в Excel, где пользователи заполняют форму и затем нажимают кнопку, чтобы отправить ее на электронный адрес команды.Я хочу, чтобы перед отправкой электронной почты появлялся ящик, позволяющий пользователям прикреплять к письму внешние вложения.
Private Sub CommandButton1_Click()
Dim user
Dim bookName As String
Dim mailAns
user = Environ("UserName")
bookName = "General Order Form 2018" + " " + Format(CStr(Date), "dd-mm-yyyy") + " " + user
If MsgBox("Do you wish to send this General Order Form to Print Services?", vbYesNo) = vbNo Then
End If
With Sheets("Order Form 2019")
If .CheckBox1 = True Then
ThisWorkbook.SendMail Recipients:=Array("Print.Services@nationwide.co.uk"), Subject:="New Print Request", Returnreceipt:=True
MsgBox "The Print Order Form has been sent to the Print Services Team, you will be contacted within 1 working day"
ThisWorkbook.Close
Exit Sub
Else
MsgBox "You have not completed the Declaration. Please accept the statements by clicking the checkbox"
End If
End With
End Sub