For Each....

B

Benoit Greuzat

I have a collection MyItems in a folder and i want to use this code to test
some numbers :
what is wrong ? I think the problem is in the first three row...


For Each MyItem in MyItems

coordxr = MyItem.UserProperties.find("XL93").value

coordyr = MyItem.UserProperties.find("YL93").value

coordrr = MyItem.UserProperties.find("Taillechantier").value

tot1 = Sqr(coordxr*coordxr-coordx*coordx)+Sqr(coordyr*coordyr-coordy*coordy)

tot2 = Abs(coordr-coordrr)

tot3 = coordr+coordrr

if tot1<tot3 and tot1>tot2 then

MyItem.Display

End if

Next
 
B

Benoit Greuzat

I have the message "UserProperties.find( ) need object.."
Here is the first part of the code. (XL93, YL93 and Taillechantier are user
defined field in my form(textbox))
Set olns = Item.Application.GetNameSpace("MAPI")

Set MyFolder1 = olns.Folders("Dossiers publics")

Set MyFolder2 = MyFolder1.Folders("Tous les dossiers publics")

Set MyFolder3 = MyFolder2.Folders("Test_Dossiers")

set MyItems = MyFolder3.Items
 

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