View Single Post
 
Old 02-05-2016, 10:43 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

It is certainly not an unknown problem, but it should not be insurmountable. The following macro added to a ribbon button can be used to force the messages in the Outbox to be sent:
Code:
Option Explicit
Sub SendAndReceiveAll()
Dim olNS As NameSpace
Dim olSyncs As SyncObjects
Dim olSync As SyncObject
Dim olItems As Items
Dim olItem As Object
Dim i As Long

    Set olNS = Application.GetNamespace("MAPI")
    Set olSyncs = olNS.SyncObjects
    Set olItems = olNS.GetDefaultFolder(4).Items
    For i = olItems.Count To 1 Step -1
        Set olItem = olItems(i)
        olItem.sEnd
        DoEvents
    Next i
    For i = 1 To olSyncs.Count
        Set olSync = olSyncs.Item(i)
        olSync.Start
        DoEvents
    Next
CleanUp:
    Set olItems = Nothing
    Set olItem = Nothing
    Set olNS = Nothing
    Set olSyncs = Nothing
    Set olSync = Nothing
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote