Problema enviar rango (formato,colores) en cuerpo de correo
publicado
compañeros tengo una gran duda, encontre este codigo para enviar un rango de datos en el cuerpo del correo, este rango tiene celdas con color, formato, etc... y existira la forma qe se vaya con todo y rubrica(firma).
Gracias a todos por sus respuestas
Sub Mail_Selection_Range_Outlook_Body()
'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
'Don't forget to copy the function RangetoHTML in the module.
'Working in Excel 2000-2013
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
Set rng = Nothing
On Error Resume Next
'Only the visible cells in the selection
Set rng = Selection.SpecialCells(xlCellTypeVisible)
'You can also use a fixed range if you want
'Set rng = Sheets("YourSheet").Range("D4:D12").SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If rng Is Nothing Then
MsgBox "The selection is not a range or the sheet is protected" & _
vbNewLine & "please correct and try again.", vbOKOnly
Exit Sub
End If
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "[email protected]"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.HTMLBody = RangetoHTML(rng)
.Send 'or use .Display
End With
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub[/CODE]
Featured Replies
Archivado
Este tema está ahora archivado y está cerrado a más respuestas.
compañeros tengo una gran duda, encontre este codigo para enviar un rango de datos en el cuerpo del correo, este rango tiene celdas con color, formato, etc... y existira la forma qe se vaya con todo y rubrica(firma).
Gracias a todos por sus respuestas