Excel:Enviar Rango De Datos Como Imagen En Email

Páginas: 3 (515 palabras) Publicado: 7 de septiembre de 2011
Envío un ejemplo con código, para poder enviar un rango de datos de una hoja excel como imagen en el cuerpo de un email. Esto es de utilidad para generar autorizaciones o reportes donde no seafácil modificar luego los datos o para realizar mejores presentaciones de reportes o tablas. Espero que les sea de utilidad. Utiliza el Outlook y el mismo debe de estar abierto.
Mando link con ejemplo.Saludos.
CODIGO CORREGIDO. AHORA FUNCIONA OK.!!

Sub Info()
'cuando el mensaje se muestra pareciera que no muestra las imágenes, pero luego las muestra bien.
'When the message is displayedit will look like
'its not embedded correctly, but when Outlook sends the
'message it will embedd it and link the proper source cid.
'
' Must set a reference to Microsoft Outlook ## ObjectLibrary to use this:
'

Dim wks As Worksheet
Dim chtObj As ChartObject
Dim imgobj As Shape
Dim rng As Range
Dim OutApp As Object
Dim OutMail As ObjectDim TempFile As String


Crea_Chart
' Email section
' Email section
Set wks = Sheets("Graph")

TempFile = Environ$("temp") & "/" & Format(Now, "dd-mm-yyh-mm-ss") & ".htm"


If wks.ChartObjects.Count > 0 Then
For Each chtObj In wks.ChartObjects
imgfile = Left(TempFile, Len(TempFile) - 4) & chtObj.ZOrder & ".png"nombre1 = Format(Now, "dd-mm-yy h-mm-ss") & chtObj.ZOrder & ".png"
chtObj.Chart.Export Filename:=imgfile, FilterName:="png"
Next chtObj
End If
'create new Outlook MailItemSet oApp = CreateObject("Outlook.Application")
Set oEmail = oApp.CreateItem(olMailItem)
oEmail.To = ""
Rem imgfile = "c:\tmp.jpg"
'add graphic as attachment to Outlook message'change path to graphic as needed
'change the src property to 'cid:your picture filename'
'it will be changed to the correct cid when its sent.
' oEmail.HTMLBody = "" &...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • como leer un email en tu blackberry
  • Rangos y rangos modificados para datos agrupados
  • Como escribir un email
  • como seleccionar rangos
  • como seleccionar rangos
  • Integracion de datos voz e imagen
  • data com
  • Como insertar una imagen

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS