Hello all,
I am relatively new to Visual Basic and have managed to muttle my way through creating a 2013 Word document that has some ActiveX controls. The final control I put in place is a Command Button that, when clicked, it sends the form off to an email. That is all working great, however, I would like to have a pop-up message that displays after the button is clicked, letting the form sender know the form has actually been sent. I have put the code I used for this Command Button below. Any help would be much appreciated.
Private Sub CommandButton4_Click()
Dim OL As Object
Dim EmailItem As Object
Dim Doc As Document
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
Doc.Save
With EmailItem
.Subject = "New Employee Account"
.Body = "New Employee Account Form is Attached!!"
.To = "emailaddress@domain.com"
.Importance = olImportanceHigh 'Or olImportanceNormal Or olImportanceLow
.Attachments.Add Doc.FullName
.Send
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub