For Each Page in Inspector. ModifiedPages

  • Thread starter Thread starter BarakamDeepa
  • Start date Start date
B

BarakamDeepa

Can anyone tell me if using "for each" has changed in outlook 2002.
The following code worked fine in the previous version and now the
code just stops on the for each line and doesn't even give me an
error. I have run out of ideas. Please let me know what to do.

for each objPage in olkInspec.ModifiedFormPages
if objPage.Name <> "Distribution"
for each objControl in objPage.Controls
y = Mid(objControl.Name,1,3)
If y = "txt" or y = "cbo" or y = "chk" Then
objControl.locked = True
ElseIf y = "cmd" then
if mid(objControl.Name,1,7) <> "cmdHelp" then
objControl.Enabled = False
end if
End if
next
End If
next
 
I've never seen it work well. When I've used it -- which is rarely -- I've used the index number to iterate the collection.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top