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

Outlook 2k3 Script: Pb extracting list of items



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 6th 06, 11:27 AM posted to microsoft.public.outlook.program_vba
news.microsoft.com
external usenet poster
 
Posts: 65
Default Outlook 2k3 Script: Pb extracting list of items

Hi all

I want to exctract from a specific folder items that math my request but my
outlook hang

if companies = "my wated companies" than put the object in body mail

myfolder contain over 9000 task

here is may code

Sub CommandButtonS1_click
Set myItem2 = Application.CreateItem(0)
Set Rep2Base = Application.GetNamespace("MAPI").Folders("publics
folders").Folders("all public folders").Folders("myfolder")
MyIndex=0
total=Rep2Base.items.count
do while myindex Total
MonIndex=MonIndex+1
Set myItem = Rep2Base.Items(MonIndex)
if MyItem.companies = "CompaniesABC" then
MyItem2.body = MyItem2.body & chr(13)
MyItem2.body = MyItem2.body & myItem.companies & ";" & myItem.mileage &
";" & myItem.Subject & ";" & myItem.UserProperties("Custom1") & ";" &
myItem.UserProperties("Custom2") & ";" & myItem.UserProperties("Custom3")
end if
loop
MyItem2.display
end sub


Tks


Ads
  #2  
Old November 6th 06, 03:24 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook 2k3 Script: Pb extracting list of items

Does it work if you access fewer items at a time in the loop? Try calling
the loop with a counter variable that does 100 items at a time and then
calling it again until all the items in the folder are processed.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"news.microsoft.com" wrote in message
...
Hi all

I want to exctract from a specific folder items that math my request but
my outlook hang

if companies = "my wated companies" than put the object in body mail

myfolder contain over 9000 task

here is may code

Sub CommandButtonS1_click
Set myItem2 = Application.CreateItem(0)
Set Rep2Base = Application.GetNamespace("MAPI").Folders("publics
folders").Folders("all public folders").Folders("myfolder")
MyIndex=0
total=Rep2Base.items.count
do while myindex Total
MonIndex=MonIndex+1
Set myItem = Rep2Base.Items(MonIndex)
if MyItem.companies = "CompaniesABC" then
MyItem2.body = MyItem2.body & chr(13)
MyItem2.body = MyItem2.body & myItem.companies & ";" & myItem.mileage &
";" & myItem.Subject & ";" & myItem.UserProperties("Custom1") & ";" &
myItem.UserProperties("Custom2") & ";" & myItem.UserProperties("Custom3")
end if
loop
MyItem2.display
end sub


Tks


  #3  
Old November 6th 06, 08:54 PM posted to microsoft.public.outlook.program_vba
bbnimda
external usenet poster
 
Posts: 29
Default Outlook 2k3 Script: Pb extracting list of items

yes if do it on 2 or 300 items it works with out problem

any idea ???


"Ken Slovak - [MVP - Outlook]" a écrit dans le message
de news: ...
Does it work if you access fewer items at a time in the loop? Try calling
the loop with a counter variable that does 100 items at a time and then
calling it again until all the items in the folder are processed.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"news.microsoft.com" wrote in message
...
Hi all

I want to exctract from a specific folder items that math my request but
my outlook hang

if companies = "my wated companies" than put the object in body mail

myfolder contain over 9000 task

here is may code

Sub CommandButtonS1_click
Set myItem2 = Application.CreateItem(0)
Set Rep2Base = Application.GetNamespace("MAPI").Folders("publics
folders").Folders("all public folders").Folders("myfolder")
MyIndex=0
total=Rep2Base.items.count
do while myindex Total
MonIndex=MonIndex+1
Set myItem = Rep2Base.Items(MonIndex)
if MyItem.companies = "CompaniesABC" then
MyItem2.body = MyItem2.body & chr(13)
MyItem2.body = MyItem2.body & myItem.companies & ";" & myItem.mileage
& ";" & myItem.Subject & ";" & myItem.UserProperties("Custom1") & ";" &
myItem.UserProperties("Custom2") & ";" & myItem.UserProperties("Custom3")
end if
loop
MyItem2.display
end sub


Tks




  #4  
Old November 6th 06, 09:57 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Outlook 2k3 Script: Pb extracting list of items

You're either running into memory leaks or more likely the 256 RPC channel
limit. The only way around that is to reduce your loop size and call the
loop code repeatedly from another procedure. Otherwise the internal object
variables created in the loop won't get released and you'll have the same
problem. When the loop procedure ends the objects are released so you need
to call the loop repeatedly.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"bbnimda" wrote in message
...
yes if do it on 2 or 300 items it works with out problem

any idea ???


  #5  
Old November 7th 06, 08:42 AM posted to microsoft.public.outlook.program_vba
news.microsoft.com
external usenet poster
 
Posts: 65
Default Outlook 2k3 Script: Pb extracting list of items

Okay

I'll try that

Tks


"Ken Slovak - [MVP - Outlook]" a écrit dans le message
de news: ...
You're either running into memory leaks or more likely the 256 RPC channel
limit. The only way around that is to reduce your loop size and call the
loop code repeatedly from another procedure. Otherwise the internal object
variables created in the loop won't get released and you'll have the same
problem. When the loop procedure ends the objects are released so you need
to call the loop repeatedly.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"bbnimda" wrote in message
...
yes if do it on 2 or 300 items it works with out problem

any idea ???




 




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
Outlook 2k3 Script: Exporting Task item to Excel news.microsoft.com Outlook and VBA 5 November 8th 06 05:01 PM
Outlook 2003 Script: How to get the Index or number of items in a Folder news.microsoft.com Outlook and VBA 5 November 6th 06 11:11 PM
Extracting individuals from a Distribution List SpencerMC Outlook - Using Contacts 1 October 12th 06 03:10 PM
Outlook 2k3 RPC over HTTP Script vzerbonia Outlook - Installation 0 July 27th 06 08:35 PM
Extracting Distribution list to Word document [email protected] Outlook - General Queries 2 April 19th 06 01:26 PM


All times are GMT +1. The time now is 05:17 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.