I created a form in word. When the user has completed the form, I would like to have a button for them to click that would email the form to a predefined mailbox. If anyone can give me some help it would be appreciated.
Ed
I created a form in word. When the user has completed the form, I would like to have a button for them to click that would email the form to a predefined mailbox. If anyone can give me some help it would be appreciated.
Ed
I found a solution in the Word Forum.
Thanks,
Ed
Hi Ed,
Welcome to VBAX
If you can post the solution or a link to it, that would be useful for anyone who finds themselves here!
Regards
MD
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Cannot find the link, but here is the code I use.
[VBA]
Option Explicit
Sub eMailActiveDocument()
Dim OL AsObject
Dim EmailItem AsObject
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 = "Insert Subject Here"
.Body = "Insert message here" & vbCrLf & _
"Line 2" & vbCrLf & _
"Line 3"
.To = "User@Domain.Com"
.Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
.Attachments.Add Doc.FullName
.Send
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
[/VBA]