Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   Unable to stop outlook to sync with IMAP account (http://www.outlookbanter.com/add-ins-outlook/94888-unable-stop-outlook-sync-imap.html)

Stop method of Sync object is not workin[_2_] September 14th 09 11:07 AM

Unable to stop outlook to sync with IMAP account
 
Hi All

my outlook profile handles two accounts one is of exchange and another one
is of IMAP. Out of these two accounts I want to sync with IMAP account in
certain cases only(like when system is idle or when exchange is offline)

For achieving this I have created an Outlook Add in that handles Syncstart
event, when sync start is fired I am just stopping that by Stop() method of
Sync object.

I have tried below code but was not able to stop the sync. Can anybady help
me on this.

private NameSpace ns;
ns = ThisAplication.Session;
private Microsoft.Office.Interop.Outlook.SyncObjectClass mySyncObject;

public void OnStartupComplete(ref System.Array custom)
{
mySyncObject = (SyncObjectClass)ns.SyncObjects[1];
mySyncObject.SyncStart += new
Microsoft.Office.Interop.Outlook.SyncObjectEvents_ SyncStartEventHandler(mySyncObject_SyncStart);
}

private void mySyncObject_SyncStart()
{
ns.SyncObjects[1].Stop();
}

Thanks in advance.


All times are GMT +1. The time now is 09:16 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com