Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 07-05-2012, 08:09 AM
OTPM OTPM is offline Hyperlink to direct email Windows 7 32bit Hyperlink to direct email Office 2010 32bit
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default SendMail Code

Hi
Replace the current code on the button with this (cut and paste):

Private Sub Send_Mail_Click()
Dim OL As Object
Dim EmailItem As Object
Dim Doc As Document

Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
Doc.Save
With EmailItem
.To = "otpm@blueyonder.co.uk; tk_hussar@hotmail.com; tk_hussar@hotmail.com" 'CHANGE THESE EMAIL ADDRESSES TO THE ONES YOU WANT TO USE.
.Subject = "Completed Flight Safety Occurence Form"
.Body = "Please find herewith completed Flight Safety Occurence Form for your action."
.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

You need to change the email addresses above as indicated. This code will send the emails without activating Outlook. Use a test email address first to test the routine.

Let me know how you get on.

OTPM (Tony)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word macro to email hyperlink pooley343 Word VBA 0 07-20-2011 01:48 AM
direct incoming email to "outlook" folder inbox John Ames Outlook 8 06-25-2011 02:51 PM
Hyperlink to attached file in email message spino Outlook 0 08-05-2010 05:56 AM
cannot access hyperlink in email mdrvo Outlook 1 05-31-2010 12:35 PM
Cannot hyperlink from an email karen1430 Outlook 0 11-25-2007 03:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:53 PM.


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