Hello all,
i have spent some time making a new user form for the hr staff.
i have a command button which will save the form and attach to a new email with email address and subject fields filled in. my only problem is once the form has been filled in and sent off the info is saved into the form. is there a way around this?
it is a macro enabled form which contains a date picker, active x text box, and check boxes. i have also protected the form from being edited.
here is the current code i am using
Code:
Private Sub CommandButton1_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 company Employee"
.Body = "" & vbCrLf & _
"" & vbCrLf & _
""
.To = "ITSupport@company.com.au"
.Attachments.Add Doc.FullName
.Display
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub