' send and recieve in outlook
' taken from Example04.vb
'
Private Sub Example04Main()

   ' start outlook
   Dim outlookApplication = New Outlook.Application()

   ' SendAndReceive is supported from Outlooks 2007 or higher
   ' we check at runtime the feature is available
   If outlookApplication.Session.EntityIsAvailable("SendAndReceive") Then
   
' one simple call outlookApplication.Session.SendAndReceive(False)
Else
MessageBox.Show(Me, _
"Example", _ "This version of MS-Outlook doesnt support SendAndReceive.", _ MessageBoxButtons.OK, _ MessageBoxIcon.Error) End If 'close outlook and dispose outlookApplication.Quit() outlookApplication.Dispose() End Sub

Last edited Jun 13, 2012 at 11:08 AM by SebastianDotNet, version 7