Podrian ayudarme por favor, soy principiante en visual basic, no se en
donde puedo modificarla para que no se tarde tanto.
Tengo la siguiente macro, pero se tarda demasiado para ejecutarse,en
ocasiones se queda trabada ( no funciona) podrian ayudarme por favor.
Muchas Gracias por su ayuda por anticipado.
Sub ENVIAR_CORREO2()
Dim strArchivo As String
strArchivo = InputBox("INGRESE EL NUMERO DE INSTANCIA DE PEOPLE SOFT",
"Ingreso de parámetros")
If strArchivo = "" Then Exit Sub '(por Ejemplo)
Dim ArchOrigen, ArchDestino
ArchOrigen = "X:\SIEF01\CONSAR\" & strArchivo & ".062"
ArchDestino = "I:\" & strArchivo & ".062"
FileCopy ArchOrigen, ArchDestino
Dim ArchOrigen1, ArchDestino1
ArchOrigen1 = "X:\SIEF01\CONSAR\" & strArchivo & ".071"
ArchDestino1 = "I:\" & strArchivo & ".071"
FileCopy ArchOrigen1, ArchDestino1
Dim ArchOrigen2, ArchDestino2
ArchOrigen2 = "X:\SIEF02V\CONSAR\" & strArchivo & ".124"
ArchDestino2 = "I:\" & strArchivo & ".124"
FileCopy ArchOrigen2, ArchDestino2
Dim ArchOrigen3, ArchDestino3
ArchOrigen3 = "X:\SIEF02V\CONSAR\" & strArchivo & ".125"
ArchDestino3 = "I:\" & strArchivo & ".125"
FileCopy ArchOrigen3, ArchDestino3
'Avant de lancer cette macro, Dans l'éditeur VBA: Faire Menu / Tools /
Reference / Cocher "Microsoft Outlook Library"
If MsgBox("¿ESTAS SEGURO QUE DESEAS ENVIARLO?", vbYesNo + vbQuestion) vbNo _
Then Exit Sub
'Code goes here instead of
Dim Ol As New Outlook.Application
Dim Olmail As MailItem
Dim CurrFile As String
Set Ol = New Outlook.Application
Set Olmail = Ol.CreateItem(olMailItem)
With Olmail
.To = Range("B1").Value
.Subject = Range("B2").Value
.Body = Range("B3").Value
.Display
.Send
'On peut switcher entre .send et .display selon que l'on veut envoyer le
mail (send) ou seulement le préparer et le vérifier(display)
MsgBox "HA SIDO ENVIADO"
End With
End Sub
Mensaje enviado desde
http://grupos.buscadoc.org
Leer las respuestas