problema con Adjunto para envio correo
Publicado por Leonard (58 intervenciones) el 11/12/2007 15:11:16
Hola Amigos :
estoy tratanto de enviar un correo, pero cuando trato de colocar el archivo adjunto utilizando una variable, String o variant, me presenta un error en cambio cuando escribo la ruta del archivo adjunto corre el sub perfectamente, alguien me puede ayudar, explicandome y dandome una solución.
Abajo les dejo el sub gracias por su ayuda
Private Sub Command20_Click()
Dim outApp As Outlook.Application
Dim outMail As Outlook.MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMail = outApp.CreateItem(olMailItem)
Dim para As Variant
Dim Concopia As Variant
Dim copiaoculta As Variant
Dim cuerpo As Variant
Dim TitMsg As Variant
Dim Archivoenvio As Variant
Set para = Nothing
Set Concopia = Nothing
Set copiaoculta = Nothing
Set cuerpo = Nothing
Set Archivoenvio = Nothing
Set para = To_Para
Set Concopia = CC_ConCopia
Set copiaoculta = CCO_CopiaOculta
Set TitMsg = Titulomsg1
Set cuerpo = Mensaje
Set Archivoenvio = Dir_Archivo
If IsNull(para) Then
MsgBox ("Insertar Destinatario")
Exit Sub
Else
If IsNull(Concopia) Then
Concopia = ""
End If
If IsNull(copiaoculta) Then
copiaoculta = ""
End If
If IsNull(cuerpo) Then
MsgBox ("Insertar información del correo")
Exit Sub
End If
End If
If IsNull(TitMsg) Then
MsgBox ("Insertar tema del mensaje")
Exit Sub
End If
With outMail
.TO = para
.CC = Concopia
.BCC = copiaoculta
.Subject = TitMsg
.Body = cuerpo
.Attachments.Add Archivoenvio ( en este punto presento el error)
.Display
End With
'
Set para = Nothing
Set Concopia = Nothing
Set copiaoculta = Nothing
Set cuerpo = Nothing
Set outMail = Nothing
Set outApp = Nothing
End Sub
estoy tratanto de enviar un correo, pero cuando trato de colocar el archivo adjunto utilizando una variable, String o variant, me presenta un error en cambio cuando escribo la ruta del archivo adjunto corre el sub perfectamente, alguien me puede ayudar, explicandome y dandome una solución.
Abajo les dejo el sub gracias por su ayuda
Private Sub Command20_Click()
Dim outApp As Outlook.Application
Dim outMail As Outlook.MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMail = outApp.CreateItem(olMailItem)
Dim para As Variant
Dim Concopia As Variant
Dim copiaoculta As Variant
Dim cuerpo As Variant
Dim TitMsg As Variant
Dim Archivoenvio As Variant
Set para = Nothing
Set Concopia = Nothing
Set copiaoculta = Nothing
Set cuerpo = Nothing
Set Archivoenvio = Nothing
Set para = To_Para
Set Concopia = CC_ConCopia
Set copiaoculta = CCO_CopiaOculta
Set TitMsg = Titulomsg1
Set cuerpo = Mensaje
Set Archivoenvio = Dir_Archivo
If IsNull(para) Then
MsgBox ("Insertar Destinatario")
Exit Sub
Else
If IsNull(Concopia) Then
Concopia = ""
End If
If IsNull(copiaoculta) Then
copiaoculta = ""
End If
If IsNull(cuerpo) Then
MsgBox ("Insertar información del correo")
Exit Sub
End If
End If
If IsNull(TitMsg) Then
MsgBox ("Insertar tema del mensaje")
Exit Sub
End If
With outMail
.TO = para
.CC = Concopia
.BCC = copiaoculta
.Subject = TitMsg
.Body = cuerpo
.Attachments.Add Archivoenvio ( en este punto presento el error)
.Display
End With
'
Set para = Nothing
Set Concopia = Nothing
Set copiaoculta = Nothing
Set cuerpo = Nothing
Set outMail = Nothing
Set outApp = Nothing
End Sub
Valora esta pregunta


0