/*
   send and recieve with Outlook
   taken from Example04.cs
*/
private void Example04Main()
{
   // start outlook 
   Outlook.Application outlookApplication = new Outlook.Application();
   
   // SendAndReceive is supported from Outlook 2007 or higher
   // we check at runtime whether the feature is available
  if(outlookApplication.Session.EntityIsAvailable("SendAndReceive"))
  {
       // one simple call
       outlookApplication.Session.SendAndReceive(false);
  }
  else
  {
       MessageBox.Show(this,
"Example",
"This version of MS-Outlook doesnt support SendAndReceive.",
MessageBoxButtons.OK, MessageBoxIcon.Error); } // close outlook and dispose outlookApplication.Quit(); outlookApplication.Dispose(); }

Last edited Jun 13, 2012 at 9:39 AM by SebastianDotNet, version 8

Comments

No comments yet.