help with control button code
Hi firstly I am not a coder and am attempting this using you and the web as my guide and way of learning so will be very appreciative of any help people are able to give.
I have a control button that at this point sends an email with a word document attached but I want it to send it as the body text of the email without the button included and is that is not possible as a PDF attachment.
thanks for your assistance in advance.
here is the code that I am using.
Private Sub CommandButton1_Click()
Dim xOutlookObj As Object
Dim xEmail As Object
Dim xDoc As Document
Application.ScreenUpdating = False
Set xOutlookObj = CreateObject("Outlook.Application")
Set xEmail = xOutlookObj.CreateItem(olMailItem)
Set xDoc = ActiveDocument
xDoc.Save
With xEmail
.Subject = "Non-Negative DAS Reprt"
.Body = "Plaese see attached documet for details of Non-Negative DAS result"
.To = "sdgmnurse@anglogoldashanti.com"
.Importance = olImportanceNormal
.Attachments.Add xDoc.FullName
.Display
End With
Set xDoc = Nothing
Set xEmail = Nothing
Set xOutlookObj = Nothing
Application.ScreenUpdating = True
End Sub
|