View Single Post
 
Old 02-16-2015, 03:25 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,144
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

I take it there is mail in the outbox? It is quite common for messages to stick in the outbox, especially if you view the contents of the Outbox. You can overcome that with a simple Outlook macro attached to a button on the ribbon e.g. as follows to force send the messages.

Code:
Option Explicit
Sub SendAndReceiveAll()
Dim olNS As NameSpace
Dim olSyncs As SyncObjects
Dim olSync As SyncObject
Dim olItems As Items
Dim olItem As MailItem
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