Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook - Using Forms (http://www.outlookbanter.com/outlook-using-forms/)
-   -   For Each Page in Inspector. ModifiedPages (http://www.outlookbanter.com/outlook-using-forms/39951-each-page-inspector-modifiedpages.html)

[email protected] February 5th 07 09:27 PM

For Each Page in Inspector. ModifiedPages
 
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


Sue Mosher [MVP-Outlook] February 5th 07 09:55 PM

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



All times are GMT +1. The time now is 05:30 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com