Ow well that's to bad. Is there any reason to use a foreach instead off a for loop? My objections for using a foreach are; - 'Ugly' indexing, as stated above - Collection can't be modified while foreach-ing the collection.
cazzz
Posts
-
The current index in the foreach -
The current index in the foreachJust a quickie for many thanks; In a for loop I can get my current index quit easy;
for (int i=0; i<8; ++i) Console.WriteLine("Current index = "+i);
But with a foreach statement it's different. I only know this ugly way;int i=0; foreach (int curInt in intCollection) { Console.WriteLine("Current index = "+i); i++; }
Maybe I'm asking the impossible because foreach is for collections so it doesn't have a strict index. But Maybe there's an index keyword? Couldn't find it at the MSDN C# site. -
MS Office development - OutlookHi all, For a while I want to do something with MS Outlook (2003). I have this 'great' idea of adding data from objects which are connected to the email. An example; If I was writing a email message to John Doe and I wanted to display his working location. Normally I would have to go into his contact details and look it up. This whole process could be done faster. By making a system like the code insight in MS Visual Studio ( you know; when you press 'sys' and a dropdownbox already displays system). People would type something like [recpient].worklocation and when the email is send, my tool replaces the [recpient].workLocation with John Doe's real work location. Now for my problem. Since I'm new to Office programming I just started reading almost everything on it. I know about the six Outlook API's and the Office addin system. But still I cant get to the email typing part. I know a 'dirty' way with hooks but that’s my last resort. I want to design this clean. So how do I make a Office Add-in which monitors the typed text in MS outlook? And how can I modify the emailed text before sending? Well that’s it, I hope someone can help me. I would really like to know more about Office development so any hints/tips/urls are welcome.