Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Activeworkbook.sendmail

Im trying to use the activeworkbook.sendmail function in a
macro, but am having trying sending to multiple
recipients. How do you do this? Also, is there any way
in which you can add text to the email rather than just
the subject?

Many thanks
Jamie

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Activeworkbook.sendmail

try this see if it is what you want but you need to add Microsoft Outlook
object library

Option Explicit
Function SendMail()

If MsgBox("Data about to send out! Continue?", vbOKCancel) = 1 Then

Dim oOutl As New Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oMail As Outlook.MailItem

Set oNS = oOutl.GetNamespace("MAPI")


oNS.Logon "MS Exchange Settings", "login", False, False ' requests
user name and password

Set oMail = oOutl.CreateItem(olMailItem)

On Error Resume Next
With oMail
.Subject = "mySubject"
'.Recipients.Add "
.Recipients.Add "
.Body = "What I want to say?"
.Attachments.Add myPath & "myFile"
.Send
End With


oNS.Logoff
Set oNS = Nothing

'Application.Quit acSaveYes
Else
'Application.Quit acSaveYes
End If


End Function

"Jamie" wrote in message
...
Im trying to use the activeworkbook.sendmail function in a
macro, but am having trying sending to multiple
recipients. How do you do this? Also, is there any way
in which you can add text to the email rather than just
the subject?

Many thanks
Jamie



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Activeworkbook.sendmail

", ")

send mail doesn't support entering text. You can use Automation to do this.
See the following sites for detailed information:


Ron de Bruin
http://www.rondebruin.nl/sendmail.htm
http://msdn.microsoft.com/library/en...odc_xlmail.asp

Dick Kuselika
www.dicks-clicks.com

Tim Zych
www.rubbershoe.com/olmail.htm

--
Regards,
Tom Ogilvy


"Jamie" wrote in message
...
Im trying to use the activeworkbook.sendmail function in a
macro, but am having trying sending to multiple
recipients. How do you do this? Also, is there any way
in which you can add text to the email rather than just
the subject?

Many thanks
Jamie



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveWorkbook.RefreshAll teepee[_3_] Excel Discussion (Misc queries) 0 November 11th 08 02:11 PM
Sendmail Mattlynn via OfficeKB.com Excel Discussion (Misc queries) 4 August 8th 08 12:21 PM
Mutiple names in ActiveWorkbook.SendMail Recipients:= daleatshel Excel Discussion (Misc queries) 2 February 5th 07 08:06 PM
ActiveWorkbook.RefreshAll nc Excel Discussion (Misc queries) 0 March 21st 06 10:50 AM
ActiveWorkBook Pete Excel Discussion (Misc queries) 3 May 9th 05 04:14 PM


All times are GMT +1. The time now is 03:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"