M
mike
Hi Everyone,
Sue Mosher MVP has been most patient with the following attempt to
customise a contact form. Her answers don't seem to be working just
this once! This code is meant to read every record in the contacts
folder. Instead I get the current record printed out infinitely. Ms
Mosher says that I should obstantiate the "ListBox3" control from
"objItem" rather than "Item". Can someone please provide me with the
precise syntax for doing that, please?
Sub cboNCRL_Click()
Dim olNS
Dim MyFolder
Dim myItems
Dim objItem
Dim objInspector
Dim objPage2
' custom variable
Dim mxztxtNCRL2
Dim intI
Set olNS = Item.Application.GetNameSpace("MAPI")
Set MyFolder = olns.GetDefaultFolder(10).Items
Set myItems = MyFolder.Restrict("[MessageClass] =
'IPM.Contact.Contact'")
Set objInspector = Item.GetInspector
For Each objItem in myItems
Set objPage2 =
Item.GetInspector.ModifiedFormPages("Assessor").ListBox3
Set mxztxtNCRL2 = objPage2.Controls("ListBox3")
For intI = 0 to mxztxtNCRL2.ListCount - 1
If mxztxtNCRL2.Selected(intI) = True Then
MsgBox mxztxtNCRL2.List(intI)
End If
Next
Next
Set mxztxtNCRL2 = Nothing
Set intI = Nothing
Set objInspector = Nothing
Set objPage2 = Nothing
Set olNS = Nothing
Set myItems = Nothing
Set MyFolder = Nothing
Set objItem = Nothing
End Sub
Sue Mosher MVP has been most patient with the following attempt to
customise a contact form. Her answers don't seem to be working just
this once! This code is meant to read every record in the contacts
folder. Instead I get the current record printed out infinitely. Ms
Mosher says that I should obstantiate the "ListBox3" control from
"objItem" rather than "Item". Can someone please provide me with the
precise syntax for doing that, please?
Sub cboNCRL_Click()
Dim olNS
Dim MyFolder
Dim myItems
Dim objItem
Dim objInspector
Dim objPage2
' custom variable
Dim mxztxtNCRL2
Dim intI
Set olNS = Item.Application.GetNameSpace("MAPI")
Set MyFolder = olns.GetDefaultFolder(10).Items
Set myItems = MyFolder.Restrict("[MessageClass] =
'IPM.Contact.Contact'")
Set objInspector = Item.GetInspector
For Each objItem in myItems
Set objPage2 =
Item.GetInspector.ModifiedFormPages("Assessor").ListBox3
Set mxztxtNCRL2 = objPage2.Controls("ListBox3")
For intI = 0 to mxztxtNCRL2.ListCount - 1
If mxztxtNCRL2.Selected(intI) = True Then
MsgBox mxztxtNCRL2.List(intI)
End If
Next
Next
Set mxztxtNCRL2 = Nothing
Set intI = Nothing
Set objInspector = Nothing
Set objPage2 = Nothing
Set olNS = Nothing
Set myItems = Nothing
Set MyFolder = Nothing
Set objItem = Nothing
End Sub