Iterating through the ModifiedFormPages collection in Outlook 2003

T

Terence Patterson

Hello folks. I've got a mystery here that's causing some problems.

The enclosed code appears to be causing some problems on a client's
machine, but not on my test machine. (I don't have direct control of
the client's machine so I need to work on second-hand information.)
The key difference I'm aware of between our machines is that my test
machine is running Office 2000 and the client's is running Office
2003.

A script error occurs on the line prefixed with '***'. It looks like
the 'p' variable that's supposed to refer to each page in the
ModifiedFormPages collection in sequence is not getting set properly.
Is there a new rule about the usage of the 'For Each...Next' structure
in Outlook 2003 for the ModifiedFormPages collection?

Thanks in advance for any advice.

Best regards,
- Terry

------------------------------------------------------------
Dim c
Dim p

If Item.Subject = "" Then
LogToFile strProcID, "Exiting"
Exit Sub
End If

If m_blnUserCanUpdate = False Then
For Each p In Item.GetInspector.ModifiedFormPages
*** For Each c In p.Controls
Select Case Left(c.Name, 3)
Case "txt"
c.Locked = True
Case "dat", "cmd", "cbo", "chk", "opt"
'The test exempts the 'View selected task(s)',
'Create New Stage Task', 'Refresh List',
' and all audited field 'History' buttons and
'Idea link' buttons from being disabled.
' It depends on the word 'Task' or 'History'
or '_Idea' appearing in each of the
' button names and not appearing in any other
button names.
If InStr(1, c.Name, "Task") = 0 _
And InStr(1, c.Name, "History") = 0 _
And InStr(1, c.Name, "_Idea") = 0 Then
c.Enabled = False
Case "_Do" '_DocSiteControl
c.ReadOnly = True
End Select
Next
Next
End If
------------------------------------------------------------
 

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