It is easy enough to add the means to insert the recipient's e-mail address
from Outlook with the marked section.
Sub MailTheForm()
Dim i As Integer
Dim bProtected As Boolean
Dim bStarted As Boolean
Dim sForm As String
Dim sAddr As String
Dim sSubject As String
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
'*****************************************************
sAddr = InputBox("Enter recipients e-mail address")
If sAddr = "" Then
MsgBox "User cancelled or no name listed", , "Cancel"
Exit Sub'
End If
'*****************************************************
sSubject = "Message subject" 'Put the subject here
'Unprotect the file
If ActiveDocument.ProtectionType <> wdNoProtection Then
bProtected = True
ActiveDocument.Unprotect Password:=""
End If
With Selection
.WholeStory
.Fields.Unlink
sForm = Selection
.HomeKey Unit:=wdStory
End With
On Error Resume Next
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.To = sAddr
.Subject = sSubject
.Body = sForm
.Send
End With
If bStarted Then
oOutlookApp.Quit
End If
Set oItem = Nothing
Set oOutlookApp = Nothing
MsgBox "The form has been sent to your Outlook outbox", vbInformation
ActiveDocument.Save
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>