Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-17-2024, 04:44 AM
gmaxey gmaxey is offline vba Send Word document as email, not attachment Windows 10 vba Send Word document as email, not attachment 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a VBA Code to print then send as an email attachment bcfd_110 Word VBA 1 09-04-2022 01:53 PM
Help to get a word document to send specific content via email using submit button ActualJax Word VBA 2 07-06-2020 04:18 PM
Outlook macro to check a value of a cell in an attachment and send an email based on that value ketangarg86 Outlook 13 03-25-2015 07:11 AM
vba Send Word document as email, not attachment Command button - save in temp folder and send email with attachment bigbird69 Word VBA 13 11-18-2012 10:06 PM
vba Send Word document as email, not attachment sending word document as email attachment causes format loss gauntlett Word 1 04-27-2012 09:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft