This project has moved. For the latest updates, please go here.

FOR EACH PROBLEM

Dec 2, 2011 at 2:44 PM

hi

sorry for my english

 
I thank you for the excellent job you did and useful

if you use foreach like this :

LateBindingApi.Core.Factory.Initialize();


Outlook.Application outlookApplication = new Outlook.Application();


Outlook._NameSpace outlookNS = outlookApplication.GetNamespace("MAPI");

foreach (NetOffice.OutlookApi.MAPIFolder ff in outlookNS.Folders)
{
Console.WriteLine(ff.Name);
}

return error (index Out of bound) in GetEnumerator of object

because COMObject[] start with 0 and this start with 1
 
Public IEnumerator GetEnumerator()
        {
   int count = Count;
   COMObject[] enumeratorObjects = new COMObject[count];
   for (int i = 1; i <= count; i++)
    enumeratorObjects[i] = this[i];

 foreach (COMObject item in enumeratorObjects)
    yield return item;
        }

if you replace with i work ok

 Public IEnumerator GetEnumerator()
        {
   int count = Count;
   COMObject[] enumeratorObjects = new COMObject[count];
   for (int i = 0; i <= count-1; i++)
    enumeratorObjects[i] = this[i+1];

   foreach (COMObject item in enumeratorObjects)
    yield return item;
        }

I hope to check out state aid

Thanks again for your work ... you're a great developer

ciao

 

 

 

Coordinator
Dec 2, 2011 at 2:56 PM

thanks for your suggestion, is an issue now. needs one day to fix them.

your issue: http://netoffice.codeplex.com/workitem/16994

thanks for show me that !
*Sebastian

Coordinator
Dec 2, 2011 at 4:29 PM

its' done, the issue is fixed.
an updated release is available.

btw: what a damn mistake from me :(