JOSELO Ayuda otra vez
Publicado por Leonard (58 intervenciones) el 11/12/2007 17:19:52
Joselo cuenta con eso, bueno vuelvo a recurrir a ti,
sigo presentando el problema, en el primer sub selecciono el archivo y lo envío como registro a mi formulario, para luego llamarla en el siguiente sub (Dir_Archivo)
Private Sub Adjunto_Click()
Dim nombrearchivo As Variant
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
If .Show = -1 Then
For Each nombrearchivo In .SelectedItems
MsgBox "The path is: " & nombrearchivo
Dir_Archivo = nombrearchivo
Next nombrearchivo
Else
End If
End With
End Sub
_-------------------------------------------------------------------------------
Private Sub Command20_Click()
Dim outApp As Outlook.Application
Dim outMail As Outlook.MailItem
Dim archattach As Outlook.Attachment
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
Set para = Nothing
Set Concopia = Nothing
Set copiaoculta = Nothing
Set cuerpo = Nothing
Set para = To_Para
Set Concopia = CC_ConCopia
Set copiaoculta = CCO_CopiaOculta
Set TitMsg = Titulomsg1
Set cuerpo = Mensaje
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 Dir_Archivo ( aqui vuelvo a presentar el error )
End With
'
Set para = Nothing
Set Concopia = Nothing
Set copiaoculta = Nothing
Set cuerpo = Nothing
Set outMail = Nothing
Set outApp = Nothing
End Sub
sigo presentando el problema, en el primer sub selecciono el archivo y lo envío como registro a mi formulario, para luego llamarla en el siguiente sub (Dir_Archivo)
Private Sub Adjunto_Click()
Dim nombrearchivo As Variant
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
If .Show = -1 Then
For Each nombrearchivo In .SelectedItems
MsgBox "The path is: " & nombrearchivo
Dir_Archivo = nombrearchivo
Next nombrearchivo
Else
End If
End With
End Sub
_-------------------------------------------------------------------------------
Private Sub Command20_Click()
Dim outApp As Outlook.Application
Dim outMail As Outlook.MailItem
Dim archattach As Outlook.Attachment
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
Set para = Nothing
Set Concopia = Nothing
Set copiaoculta = Nothing
Set cuerpo = Nothing
Set para = To_Para
Set Concopia = CC_ConCopia
Set copiaoculta = CCO_CopiaOculta
Set TitMsg = Titulomsg1
Set cuerpo = Mensaje
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 Dir_Archivo ( aqui vuelvo a presentar el error )
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