A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Restrict method problem



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 7th 06, 07:03 PM posted to microsoft.public.outlook.program_vba
Mike Epp
external usenet poster
 
Posts: 2
Default Restrict method problem

Dmitry,
After cleaning up the routine I use looks as the following:

protected void UserContacts(string LoginName)
{
Outlook._Application olApp =3D (Outlook._Application) new Outlook.Applicatio=
n();
Outlook.NameSpace mapiNS =3D olApp.GetNamespace("MAPI");
Outlook.Recipient oRecepient =3D mapiNS.CreateRecipient(LoginName);
oRecepient.Resolve();
if (oRecepient.Resolved)
{
Outlook.Folders myFolders;
Outlook.MAPIFolder myContFolder;
Outlook._ContactItem myContact;
myContFolder =3D mapiNS.GetSharedDefaultFolder(oRecepient,Outlook.O lDefau=
ltFolders.olFolderContacts);
myFolders =3D myContFolder.Folders;

myContFolder =3D myFolders.Item("CustomContacts"); //Custom Contacts folder
Outlook._Items myConts;
myConts =3D myContFolder.Items;
if (myConts.Count 0)
{
myConts.Sort("[LastName]",0);
myContact =3D (Outlook._ContactItem)myConts.GetFirst();
do
{
Console.WriteLine(myContact.LastName + " " + myContact.FirstName);
myContact =3D (Outlook._ContactItem)myConts.GetNext();
}
while (myContact !=3D null);
}
myConts =3D null;
myContact =3D null;
myFolders =3D null;
myContFolder =3D null;
oRecepient =3D null;
mapiNS.Logoff();
mapiNS =3D null;
olApp =3D null;
}
}

The application goes through number of exchange users and theirs contacts. Number o=
f contacts per user is always less then 100. The application crashes after total numb=
er of processing contacts reaches 249. Using Marshal.ReleaseComObject doesn=E2=80=
=99t change a situation at all. But application works fine if I kill Outlook.exe proc=
ess after each user iteration or if counter of processed contacts reaches 248. =

The 250 contacts limitation issue looks legitimate according to the article: http:=
//support.microsoft.com/?kbid=3D830829. Is there any more elegant walk around t=
hen killing Outlook.exe process? Change registry settings and increase number of c=
ontacts from 250 to any larger number doesn=E2=80=99t look very nice as well. Thank y=
ou very much!
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
savemode in Close method Long Nguyen Outlook - Using Forms 2 March 30th 06 07:44 AM
Restrict Method DNW emanson Outlook and VBA 14 March 28th 06 05:47 AM
GetItemFromID method on a public folder in the namespace Robert Squire Outlook and VBA 1 February 24th 06 01:31 PM
Best method for using Outlook out of the office Bob Outlook - General Queries 1 January 31st 06 02:05 AM
Restrict jim Add-ins for Outlook 2 January 13th 06 08:14 PM


All times are GMT +1. The time now is 07:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.