MANDAR MAIL COMO UNA IMAGEN

3 envíos / 0 nuevos
Último envío
tetorin
Imagen de tetorin
Offline
última acción: Hace 8 meses 1 día
Nivel 1 - 200 puntosNivel 2 - 500 puntosNivel 3 - 1000 puntosNivel 4 - 2000 puntos
alta: 26/05/2011 - 02:57
Puntos: 3262
MANDAR MAIL COMO UNA IMAGEN

HOLA A TODOS

HE ESTADO TRATANDO DE ENVIAR UN E-MAIL SELECIONANDO UNRANGO DE CELDAS EN EXCEL PERO EN MI CORREO QUISIERA QUE SE FUERA COMO IMAGEN Y NO COMO TEXTO YA QUE LOS DATOS NO SE VAN ORDENADOS ESTE ES EL CODIGO QUE USO

 

Sub Send_Unformatted_Rangedata()
   Dim noSession As Object, noDatabase As Object, noDocument As Object
   Dim vaRecipient As Variant
   Dim rnBody As Range
   Dim Data As DataObject
 
   Const stSubject As String = "Send only an unformatted range of data."
   Const stMsg As String = "Data as part of the e-mail's body."
   Const stPrompt As String = "Please select the range:"
 
   'This is one technique to send an e-mail to many recipients but for larger
   'number of recipients it's more convenient to read the recipient-list from
   'a range in the workbook.
   vaRecipient = VBA.Array("first@xldennis.com", "second@xldennis.com")
 
   On Error Resume Next
   Set rnBody = Application.InputBox(Prompt:=stPrompt, _
         Default:=Selection.Address, Type:=8)
 
   'The user canceled the operation.
   If rnBody Is Nothing Then Exit Sub
 
   On Error GoTo 0
 
   'Instantiate Lotus Notes COM's objects.
   Set noSession = CreateObject("Notes.NotesSession")
   Set noDatabase = noSession.GETDATABASE("", "")
 
   'Make sure Lotus Notes is open and available.
   If noDatabase.IsOpen = False Then noDatabase.OPENMAIL
 
   'Create the document for the e-mail.
   Set noDocument = noDatabase.CreateDocument
 
   'Copy the selected range into memory.
   rnBody.Copy
 
   'Retrieve the data from then copied range.
   Set Data = New DataObject
   Data.GetFromClipboard
 
   'Add data to the mainproperties of the e-mail's document.
   With noDocument
      .Form = "Memo"
      .SendTo = vaRecipient
      .Subject = stSubject
      'Retrieve the data from the clipboard.
      .BODY = Data.GetText & " " & stMsg
      .SaveMessageOnSend = True
   End With
 
   'Send the e-mail.
   With noDocument
      .PostedDate = Now()
      .Send 0, vaRecipient
   End With
 
   'Release objects from memory.
   Set noDocument = Nothing
   Set noDatabase = Nothing
   Set noSession = Nothing
 
 
   'Activate Excel for the user.
   AppActivate "Microsoft Excel"
 
   'Empty the clipboard.
   Application.CutCopyMode = False
 
   MsgBox "The e-mail has successfully been created and distributed.", vbInformation
 
End Sub

Etiquetas: 

pacomegia
Imagen de pacomegia
Offline
última acción: Hace 2 días 17 horas
Nivel 1 - 200 puntosNivel 2 - 500 puntosNivel 3 - 1000 puntosNivel 4 - 2000 puntosNivel 5 - 4000 puntosadministrador
alta: 27/12/2006 - 23:26
Puntos: 11175
Re: MANDAR MAIL COMO UNA IMAGEN

estás copiando el rango directamente con 

 rnBody.Copy

 

Puedes copiar una imagen a partir del rango con el método CopyPicture

por ejemplo:

 rnBody.CopyPicture xlScreen, xlPicture

 

Ya tienes el rango como una imagen en el portapepeles.

 

Ahora el problema es cómo pegar esa imagen en el cuerpo de tu mensaje.

¿qué hace ese    Data.GetFromClipboard  ?

¿qué métodos tiene ese objeto o qué admite el .BODY de tu mensaje?

¿el objeto noDocument tiene un método .Paste?

 

------
Ya sé Excel, pero necesito más.

Aaron (no verificado)
Imagen de Aaron
Re: MANDAR MAIL COMO UNA IMAGEN

[comentario movido a tema nuevo en el foro http://www.necesitomas.com/mandar-tabla-dinamica-mail-como-imagen ]