Thread: E-mail Code
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
dude dude is offline
external usenet poster
 
Posts: 12
Default E-mail Code

I am an XP user & do a simlar thing in Excel to you.
Line of code I use is: ActiveWorkbook.SendMail Recipients:=
to date, this has thrown up any warning boxes!
If this does not work you can try following:

Sub SendEmail()
Dim olapp As Object
Dim olmail As Object
Set olapp = CreateObject("outlook.application")
Set olmail = olapp.createitem(0)
With olmail
.Subject = "Test" 'enter subject here
.Recipients.Add " 'add email
address here
.body = "This is a Test" 'enter message here
.attachments.Add 'reference any attachement
.send
End With
Set olmail = Nothing
Set olapp = Nothing
End Sub

Hope helpful

-----Original Message-----
Hi,

I have a button that automatically sends an e-mail to
managers of the current worksheet. I have to make a

slight
change to the sheet for each manager before I send it out.

When I click the button I get the message that Excel is
trying to automatically send an E-mail, and it may

contain
a virus..do you want to send the mail..a progress bar
completes and a Yes No option appears..I click yes and

the
e-mail sends.

I use Office XP, this didn't happen in Excel 97, is there
a way to get rid of that box?


Thanks
.