Access "" Outlook |
If pOutbox.Items.Count > 0 Then If (pOutbox.Items(pOutbox.Items.Count).Subject = Subj) Then, On Error Resume Next ?
Private Function SendIfor(ByVal Subj As String, ByVal Body As String, ByVal Addr As String) As Integer Dim pApp As Outlook.Application Dim pMail As Outlook.MailItem Dim pNS As Outlook.NameSpace Dim pOutbox As Outlook.Folder Dim pSent As Outlook.Folder ' Set pApp = New Outlook.Application Set pMail = pApp.CreateItem(0) Set pNS = pApp.GetNamespace("MAPI") Set pOutbox = pNS.GetDefaultFolder(olFolderOutbox) Set pSent = pNS.GetDefaultFolder(olFolderSentMail) pMail.To = Addr pMail.Subject = Subj pMail.BodyFormat = 2 ' HTML pMail.HTMLBody = Body ' pMail.Send DoEvents ' , SendIfor = 1 If pOutbox.Items.Count > 0 Then If (pOutbox.Items(pOutbox.Items.Count).Subject = Subj) Then SendIfor = 0 End If End If If pSent.Items.Count > 0 Then If (pSent.Items(pSent.Items.Count).Subject = Subj) Then SendIfor = 0 End If End If Set pMail = Nothing Set pApp = Nothing Set pNS = Nothing Set pOutbox = Nothing Set pSent = Nothing End Function
http://www.sql.ru/forum/1295219/kak-iz-access-korrektno-posmotret-papku-ishodyashhie-v-outlook