Ayuda, insertar imagen en el cuerpo del correo con excel VBA
Publicado por Angela Navarro (1 intervención) el 28/04/2020 06:35:02
Buenas noches,
podría alguien ayudarme a introducir el código necesario para que mi macro de excel adjunte una imagen en el cuerpo del correo
Gracias
podría alguien ayudarme a introducir el código necesario para que mi macro de excel adjunte una imagen en el cuerpo del correo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Sub envio_correo()
Application.ScreenUpdating = False
Dim outlookOBJ As Object
Dim mitem As Object
nume_regi = Range("E21").End(xlDown).Row - 21
For i = 1 To nume_regi
Set outlookOBJ = CreateObject("Outlook.Application")
Set mitem = outlookOBJ.CreateItem(olMailItem)
asunto = Cells(5, 5).Value
ruta_archivo = Cells(7, 5).Value
Cuerpo = Cells(9, 2).Value
persona = Cells(21 + i, 5).Value
empresa = Cells(21 + i, 6).Value
Enviara = Cells(21 + i, 7).Value
With mitem
.To = Enviara
.Subject = asunto & " su " & Codigo
.Body = "Buen día " & StrConv(Left(persona, InStr(persona, " ")), vbProperCase) & vbCrLf & vbCrLf & Cuerpo & vbCrLf & vbCrLf & ""
'.Send
End With
If ruta_archivo <> "" Then
With mitem
.Attachments.Add (ruta_archivo)
End With
End If
With mitem
.Send
End With
Next i
Range("E5").Select
Application.ScreenUpdating = True
Set outlookOBJ = Nothing
Set mitem = Nothing
MsgBox ("Finalizado se enviaron " & nume_regi & " Correos con exito"), vbOKOnly, "Correos enviados"
End Sub
Sub selec_archivo21()
On Error GoTo a2
ruta_archivo = Application.GetOpenFilename(Title:="Selecciona el archivo para Mail")
If ruta_archivo = False Then
Exit Sub
Else
Cells(7, 5).Value = ruta_archivo
End If
a2:
End Sub
Gracias
Valora esta pregunta


0