View Single Post
  #3  
Old September 4th 08, 02:10 PM posted to microsoft.public.outlook.program_forms
bbnimda
external usenet poster
 
Posts: 94
Default Outlook Script Have Pb with Do While Loop

Hello Sue

I don't Want to perform another loop

I just want to skip item inside my "Do loop" and I can't use in fact all
my item meet more than 4 criteria and in this list I want to skip some
Item that meet 2 Criteria

after each loop I Add to a list the item and I tagg it with a specific color
to an Excel file and after each loop I go to the next line on Excel if I
ignore an item I'll
have blank line between writen lines


here a part of my code
============================
set myitem = items.find(..........)
Do while
if condition1 then
Itemcolor = 1
if condition2 then
Tagg = A
else
Tagg = B
end if
else
if THECONDITON then
HERE WHERE I WANT TO SKIP
I don't want continue with this Item and bo back to the begining
of my loop and proceed with the next item
end if
end

action1
action2
action3

Actionx = add information about the item to Excel by putting in each cell
item infomation by scrolling column
ActionZ = go to the next line in Excel
loop


I Hope I'm clear...

============================
"Sue Mosher [MVP-Outlook]" a écrit dans le message
de news: ...
If you want another loop to run inside the If ... End If block, then that
needs to begin with a Do statement, just like the outer look.

If you want to perform actions only on items meeting certain criteria,
then
put those actions inside an If ... ENd If block, for example:

Do While not (MyItem is Nothing)
if Not MyItem.companies = "COMPNAME" then
Action1
Action2
Action3
end if
loop
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"bbnimda" wrote:

Hi all

I'm using a custom Outlook form

I this form I use Do while loop, it work fine but Now I need to skip
some
item that meet specific conditions so I added an if then loop end if

My working Script
===============================
Do While not (MyItem is Nothing)
Action1
Action2
Action3
loop
===============================

In my New Script I want to skip all Item that have companies name
"COMPNAME"
when I add an other loop inside the "if then" my form don't work and
return
message that "do" is missing

===============================
Do While not (MyItem is Nothing)
Action1
Action2
Action3
if MyItem.companies = "COMPNAME" then
loop
end if
loop
===============================

thks for Help





Ads