Visual Basic para Aplicaciones - problemas_con_ e-mail

Life is soft - evento anual de software empresarial
 
Vista:

problemas_con_ e-mail

Publicado por Enrique R (6 intervenciones) el 05/07/2006 13:09:33
Hola:

Primero que nada les digo que ya tengo rato con este problema y he puesto esta pregunta en este foro en otras ocacion y no he tenido respuesta, espero y me ayuden

Necesito mandar una hoja de excel por correo electronico . pero necesito que esta se mande como message body

y no como attachment

Tengo el siguiente codigo, pero si ejecuto de esta forma la macro. me manda todo el libro como archivo adjunto........... y yo lo que necesito es que me mande solo la hoja pero no como attach ............ quiero que me la mande como message body

espero y me puedan ayudar

Saludos

Desde Chihuahua, Mexico

Sub Mail_ActiveSheet()
Dim wb As Workbook
Dim strdate As String
Dim stEmail As String

strdate = Format(Now, "dd-mm-yy h-mm-ss")
strEmail = "[email protected]"
Application.ScreenUpdating = False

ActiveSheet.Copy

Set wb = ActiveWorkbook

With wb
.SaveAs ThisWorkbook.Name & " " & strdate & ".xls"
.SendMail strEmail, "Shit Report1"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With

Application.ScreenUpdating = True
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:problemas_con_ e-mail

Publicado por Joint (20 intervenciones) el 07/05/2007 22:07:34
Quizás esto te pueda servir, la diferencia es que envía un rango de celdas de la hoja activa.


Sub Send_Range()

' Select the range of cells on the active worksheet.
ActiveSheet.Range("A1:E20").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True

' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "Aca pones un mensaje que quieras enviar junto con la tabla"
.Item.To = "Dirección de correo electrónico"
.Item.Subject = "Asunto"
.Item.Send
End With
End Sub

Eso es... saludos, avisame si te sirvió.

Joint
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar