View Single Post
 
Old 05-17-2024, 04:44 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,602
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub eMailActiveDocument()
Dim OL As Object
Dim EmailItem As Object
Dim oEditor As Object
Dim Doc As Document

Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
Doc.Save
Doc.Content.Copy

With EmailItem
  .Subject = "Insert Subject Here"
  .BodyFormat = olFormatRichText
        Set oEditor = .GetInspector.WordEditor
        oEditor.Content.Paste
  .To = "gmaxey@gregmaxey.com"
  .Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
  .Display 'Send
End With

Application.ScreenUpdating = True

Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing

End Sub

If you want to use "Send" instead "Display" you are probably going to have to insert a delay before killing the Outlook instance.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote