View Single Post
  #2  
Old February 5th 07, 09:55 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default For Each Page in Inspector. ModifiedPages

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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message oups.com...
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

Ads