loImage = toImageList.ListImages(lcIconKey) IF NOT VARTYPE(loImage)='O' Add new image... ENDIFMy other choice is as follows but the code is called many times and itterating through the collection very call seems a bit much
llImageExists = .F. FOR EACH loImage IN toImageList.ListImages IF loImage.KEY = lcIconKey llImageExists = .T. ENDIF ENDFOR IF NOT llImageExists Add new image... ENDIF