Vic, This sounds very much to me like a bug in clips.searchText. I don't see you're doing anything wrong, and I can't think of what you can do except to give up use of searchText (luckily you can do this manually) until it's worked out. You shouldn't need to "reset" anything, as the variable is recreated each time. However, you might try adding a "activeWindow.redraw" at the beginning of the sub, or perhaps only after you've found them, to see if it helps: hth, Chip
_____ From: Vic Beckley [mailto:[email protected]] Sent: Friday, March 05, 2010 8:15 PM To: [email protected] Subject: Clearing a collection of clips Hi all, I am using the following sub to find certain clips when they exist on the screen. Sub timeInfo() If ActiveWindow.ModuleName = "EZCDDAX" Then Dim C, D Set C = ActiveWindow.Clips.SearchText("Used:") Set D = ActiveWindow.Clips.SearchText("Available:") If C.Count > 0 And D.Count > 0 Then Speak c(1).Line.ClipsText Speak D(1).Line.ClipsText Mouse.Position = D(1).Position.ScreenPoint Else Speak "Statistics not found" End If End If End Sub The problem is that when I am on a screen where the searched for clips do not exist and I have found them previously I get an error that C(1) does not exist. How do I set the collection variables, C and D, back to having a count of 0. Once the clips are found, they always have a count of 1. Please help. Vic __________ Information from ESET NOD32 Antivirus, version of virus signature database 4919 (20100305) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
