The following code in a macro can be used the send the active document as
the body of an email message IF the sender is using Microsoft Outlook. It
will require that in your template, you set a reference via Tools>References
in the Visual Basic Editor to the Microsoft Outlook #.0 Object Library.
Dim source As Document
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
Set source = ActiveDocument
' Check if Outlook is running. If it is not, start Outlook
On Error Resume Next
Set oOutlookApp = GetObject(, "Outlook.Application")
'oOutlookApp.DefaultProfileName
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
source.Sections(j).Range.Copy
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.Subject = "Document Request"
.BodyFormat = olFormatHTML
.Display
Set objDoc = .GetInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.Paste
.To = "(e-mail address removed)"
.cc = "(e-mail address removed)"
.Send
End With
Set oItem = Nothing
' Close Outlook if it was started by this macro.
If bStarted Then
oOutlookApp.Quit
End If
MsgBox source.Sections.Count - 1 & " messages have been sent."
'Clean up
Set oOutlookApp = Nothing
You could call the macro by the use of a macrobutton on the document
See the article "Using MacroButton fields†at:
http://www.word.mvps.org/FAQs/TblsFldsFms/UsingMacroButton.htm
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP, originally posted via msnews.microsoft.com