Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Outlook Newsgroups
Outlook Program Addins
Weird problem with Outlook and Exchange Server
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Luc, post: 4801813"] Hi! If I loop though a folder that contains many items (like 150 and up), my app will either hang, or it will loop infinitely. Say, there are 2000 items, it will go well for the first 12 items, then it will loop pass the 2000 items, like going to 23425253. I don't have Exchange Server so I can't debug that problem. It runs fine when Outlook isn't using Exchange Server... Anyone ever experienced that problem? Here's some code: CComPtr<Outlook::_Items> pItems .... pItems->get_Count( &lCount ); for(INT i=lCount;i>0;i--) { CComPtr<IDispatch> pDisp = NULL; vCnt = i; pItems->Item( vCnt, &pDisp ); if( pDisp ) { CComPtr<Outlook::_MailItem> pMailItem = NULL; if( SUCCEEDED( pDisp->QueryInterface( IID_MailItem, (void**)&pMailItem ) ) ) { ATLASSERT( pMailItem ); if( pMailItem ) { if( !reg.m_bSomething ) { if( DoSomething( pMailItem, FALSE ) ) { nNb++; } } } pMailItem->Close( olDiscard ); } } } But would anyone have an example of how to loop through the items of an Outlook folder that is safe with and without Exchange Server? VC++, C#, VB, it doesn't matter, it's all good! Thanks! [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Outlook Newsgroups
Outlook Program Addins
Weird problem with Outlook and Exchange Server
Top