Value does not fall within the expected range.

Add-in Express™ Support Service
That's what is more important than anything else

Value does not fall within the expected range.
 
Manjunath cv




Posts: 3
Joined: 2007-09-14
I am using Outlook Security manager to block popups as my application is up and ready when i integrated and added few lines of Outlook Securtiy API's i am getting this error see the stack trace below

Source : SecurityManager.2005
Method : Connect
Date : 3:19:06 PM
Time : 9/19/2007
Computer : amough
Error : Value does not fall within the expected range.
Stack Trace : at AddinExpress.Outlook.IOutlookSecurityManager2.Connect(Object vTarget)
at AddinExpress.Outlook.SecurityManager.ConnectTo(Object outlookApp)
at com.olk.connector.moutlook.OutlookContact.DeleteElement(String key) in C:\Documents and Settings\amoghg.olkR\Desktop\olkSyncClient\Microsoft Outlook\connectornew\com\olk\connector\moutlook\OutlookContact.cs:line 555
at com.olk.syncml.Delete.ProcessCommand(Object ObjProcess) in C:\Documents and Settings\amoghg.olkR\Desktop\olkSyncClient\SyncMLParser\SyncMLParser\com\OLK\syncml\Delete.cs:line 163
^^-------------------------------------------------------------------^^

Can any one say what could be the error i get this error in some cases where it cannot be caught through debugging..... but i will get this error when i set the securityManager1.DisableOOMWarnings = true;

PLEASE FIND THE SAMPLE CODE BELOW


try{
if (profile == "Outlook 2003")
{

mout2003.Application app = new mout2003.Application();
mout2003._NameSpace ns = app.GetNamespace("MAPI");
ns.Logon(null, null, true, true);
mout2003.MAPIFolder contactsFolder = ns.GetDefaultFolder(mout2003.OlDefaultFolders.olFolderContacts);
mout2003.Items items = contactsFolder.Items;
mout2003.ContactItem oCt1;

this.securityManagerCon = new AddinExpress.Outlook.SecurityManager();
securityManagerCon.ConnectTo(app);
securityManagerCon.DisableOOMWarnings = true;


for (int d = 1; d <= items.Count; d++)
{
if (d == 1)
obj = items.GetFirst();
else
obj = items.GetNext();

if (Information.TypeName(obj).ToLower() == "contactitem")
{
oCt1 = (mout2003.ContactItem)obj;
if (oCt1.EntryID.ToString() == key)
{
oCt1.Delete();
goto g1;
}
}
}

mout2003.Folders folds = contactsFolder.Folders;
mout2003.MAPIFolder fold = folds.GetFirst();
for (int c = 1; c <= folds.Count; c++)
{
del = check_folder_level22003(fold, key);
if (del)
goto g1;
fold = folds.GetNext();
}
goto g2;

g1:
Program.lblstatus = "Deleting Contacts in Client : " + (lotusUsers.deinclt++);
SyncObject newObj = new SyncObject(key, null, SyncObjectType.DELETE);
_changeLog.updateChangeLog(newObj);
g2:


if (items != null)
Marshal.ReleaseComObject(items);
if (contactsFolder != null)
Marshal.ReleaseComObject(contactsFolder);
if (ns != null)
Marshal.ReleaseComObject(ns);
return;
}
catch (System.Exception ex)
{
}

Posted 19 Sep, 2007 06:40:25 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Manjunath.

What is the 'mout2003.Application' class? Please try to use the Microsoft.Office.Interop.Outlook.Application class instead.


Posted 19 Sep, 2007 15:39:21 Top