Pregunta: | 67821 - NO ME MANDA CORREO |
Autor: | hector a |
el visual me manda esta sintaxis como error Set oSess = CreateObject("Notes.NotesSession") porque? no me quiere funcionar agrego 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:COMPLEXENSAMBLEADM 003 PINTURA 02 MANTENIMIENTO (Alex Lopez) 4 RESPUESTAREPORTE DE EFICIENCIAREPORTES DE MTTOFALLASREPORTE 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 |