View Single Post
 
Old 02-13-2019, 07:29 AM
Kieranf Kieranf is offline Windows 7 64bit Office 2019
Novice
 
Join Date: Feb 2019
Posts: 1
Kieranf is on a distinguished road
Default Problem with submitting a word form via email.

I have created the following code (via a lot of searching) but the attached form is blank. Can anyone see what is wrong?



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
 
With EmailItem
.Subject = "Hello"
.Body = "Insert message here or just send"
 
.To = "acas-media@media.co.uk"
.Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
.Attachments.Add Doc.FullName
.Display
.Save
 
 
End With
 
Application.ScreenUpdating = True
 
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
 
End Sub
Reply With Quote