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
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.
[comentario movido a tema nuevo en el foro http://www.necesitomas.com/mandar-tabla-dinamica-mail-como-imagen ]