Outlook Script:


B

bbnimda

Config SBS2k3 & Outlook 2k3

Hi all,

My script hang's for non comprehesible reason,

I've two contact folders profesional(3500 item) and private(1100 item)

in My Form I list all contact in a combo

When I do'it on private all is Ok , but when I do the same thing on
Professional it hang's every time on the 242st item

there's no Pb on this item, (I delete it but it still not working) here is a
part of my code

TKS FOR Help

====================================================================

Set FormPage = Item.GetInspector.ModifiedFormPages("ContactP")

Set Control = FormPage.Controls("TmpLst")

Set myFolder = Application.GetNamespace("MAPI").Folders..........

Set myItems = myFolder.Items

myItems.Sort "[CompanyName]", False

For Each myItems in myItems

nbr = nbr + 1

Ctct = nbr & vbtab& myitems.FullName

Control.addItem Ctct

next

=======================================================
 
Ad

Advertisements

M

Michael Bauer [MVP - Outlook]

For Each myItems in myItems

That won't work at all. Either you have myItem declared as ContactItem and
there's also a distribution list in the folder, or you run into the problem
that Outlook sometimes doesn't dispose references.

For the latter this might be a workaround (it's a sample for MailItems,
please adapt the LoopItems procedure):
http://www.vboffice.net/sample.html?mnu=2&pub=6&lang=en&smp=36&cmd=showitem

--
Best regards
Michael Bauer - MVP Outlook
Synchronize Outlook Categories:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>


Am Wed, 9 Jan 2008 16:07:52 +0100 schrieb bbnimda:
Config SBS2k3 & Outlook 2k3

Hi all,

My script hang's for non comprehesible reason,

I've two contact folders profesional(3500 item) and private(1100 item)

in My Form I list all contact in a combo

When I do'it on private all is Ok , but when I do the same thing on
Professional it hang's every time on the 242st item

there's no Pb on this item, (I delete it but it still not working) here is a
part of my code

TKS FOR Help

====================================================================

Set FormPage = Item.GetInspector.ModifiedFormPages("ContactP")

Set Control = FormPage.Controls("TmpLst")

Set myFolder = Application.GetNamespace("MAPI").Folders..........

Set myItems = myFolder.Items

myItems.Sort "[CompanyName]", False

For Each myItems in myItems

nbr = nbr + 1

Ctct = nbr & vbtab& myitems.FullName

Control.addItem Ctct

next

=======================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top