For Each Page in Inspector. ModifiedPages

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
 
S

Sue Mosher [MVP-Outlook]

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
 

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