no me manda mail

3 envíos / 0 nuevos
Último envío
tetorin
Imagen de tetorin
Offline
última acción: Hace 8 meses 1 día
Nivel 1 - 200 puntosNivel 2 - 500 puntosNivel 3 - 1000 puntosNivel 4 - 2000 puntos
alta: 26/05/2011 - 02:57
Puntos: 3262
no me manda mail

por que no me funciona mi macro es para mandar correo y se deiene aqui

Set oSess = CreateObject("Notes.NotesSession")

anexo el completo

 

Function CORREO()
Application.ScreenUpdating = False
Dim oSess As Object
Dim oDB As Object
Dim oDoc As Object
Dim oItem As Object
Dim direct As Object
Dim Var As Variant
Dim flag As Boolean
Dim lista(40) As Variant

Application.Workbooks("REPORTE DE TURNO.xlsx").Activate
ActiveWorkbook.Save
ActiveWorkbook.Close

Application.Workbooks("REPORTE MTTO MOD.xlsm").Activate
Sheets("CORREO").Select


I = 0
J = 2
INICIO:
If Range("B" & J) = "" Or J = 42 Then
GoTo FIN
Else
lista(I) = Range("B" & J).Text
End If
I = I + 1
J = J + 1
GoTo INICIO
Sheets("FORMATO").Select
FIN:

Set oSess = CreateObject("Notes.NotesSession")
Set oDB = oSess.GETDATABASE("", "")
Call oDB.OPENMAIL
flag = True
If Not (oDB.IsOpen) Then flag = oDB.Open("", "")

If Not flag Then
MsgBox "Can't open mail file: " & oDB.SERVER & " " & oDB.FILEPATH
GoTo exit_SendAttachment
End If
On Error GoTo err_handler

'Building Message
Set oDoc = oDB.CREATEDOCUMENT
Set oItem = oDoc.CREATERICHTEXTITEM("BODY")
oDoc.Form = "Memo"
oDoc.Subject = "REPORTE DE TURNO" '"PRUEBA DE REPORTE"
oDoc.sendto = lista
oDoc.body = "ESTE ES EL REPORTE DE TURNO Y LAS GRAFICAS HASTA EL DIA DE HOY" '"PRUEBA DE FUNCIONAMIENTO DE REPORTE DE TURNO"
oDoc.postdate = Date
oDoc.SAVEMESSAGEONSEND = True

'Attaching DATABASE
Call oItem.EMBEDOBJECT(1454, "", "S:\COMPLEX\ENSAMBLE\ADM 003 PINTURA\002 MANTENIMIENTO (Alex Lopez)\04 RESPUESTA\REPORTE DE EFICIENCIA\REPORTES DE MTTO\FALLAS\REPORTE DE TURNO.xlsx")
oDoc.visable = True
'Sending Message

oDoc.SEND False
exit_SendAttachment:
On Error Resume Next
Set oSess = Nothing
Set oDB = Nothing
Set oDoc = Nothing
Set oItem = Nothing
'Done
Exit Function
err_handler:
If Err.Number = 7225 Then
MsgBox "File doesn't exist"
Else
MsgBox Err.Number & " " & Err.Description
End If
On Error GoTo exit_SendAttachment
Application.ScreenUpdating = True
End Function

 

 

espero me puedas ayudar

 

Saludos............

Etiquetas: 

pacomegia
Imagen de pacomegia
Offline
última acción: Hace 3 días 13 horas
Nivel 1 - 200 puntosNivel 2 - 500 puntosNivel 3 - 1000 puntosNivel 4 - 2000 puntosNivel 5 - 4000 puntosadministrador
alta: 27/12/2006 - 23:26
Puntos: 11175
¿qué error da?

Cuando se detiene ¿qué error da?

 

Si es simplemente que no reconoce ese tipo de objeto, es que no encuentra en el equipo la biblioteca de lotus notes, pero me imagino que si lo tienes instalado en tu equipo esa biblioteca sí estará accesible y el error será otro, aunque se detenga en la primera linea.

 

Mira esta página http://www.rondebruin.nl/win/s1/notes/notes.htm

 

------
Ya sé Excel, pero necesito más.

tetorin
Imagen de tetorin
Offline
última acción: Hace 8 meses 1 día
Nivel 1 - 200 puntosNivel 2 - 500 puntosNivel 3 - 1000 puntosNivel 4 - 2000 puntos
alta: 26/05/2011 - 02:57
Puntos: 3262
Re: ¿qué error da?

GRACIAS POR LA INFORMACION EL DETALLE ES QUE AMI MI CORREO ME PIDE CONRASEÑA PERO HICE LA PRUEBA CON UNA CORREO QUE NO PIDE CUENTA Y FUNCIONO DE MARAVILLA...