* Method AddOneAttachment LPARAMETERS tcFile LOCAL lcFile, lcImgKey, lnIndexSmall, lnIndexLarge, loIconBuddy lcFile = IIF( VARTYPE(tcFile) = "C", tcFile, GETFILE() ) llOK = .F. IF NOT EMPTY(lcFile) loIconBuddy = NEWOBJECT("iconbuddy", "iconbuddy.vcx") lnIndexSmall = 0 lnIndexLarge = 0 lcImgKey = LOWER(JUSTEXT(lcFile)) * No extension case IF EMPTY(lcImgKey) lcImgKey = 'NONE' ENDIF *-- Extract the large associated Image to the first ImageList lnIndexLarge = loIconBuddy.Extract2ImageList(lcFile, lcImgKey,; THIS.ImageListLarge, .F., -1) *-- and now the small one lnIndexSmall = loIconBuddy.Extract2ImageList(lcFile, lcImgKey,; THIS.ImageListSmall, .T., -1) * Make sure that we got associated icon IF lnIndexLarge > 0 AND lnIndexSmall > 0 Thisform.oLV.OBJECT.Icons = THIS.ImageListLarge.OBJECT Thisform.oLV.OBJECT.SmallIcons = THIS.ImageListSmall.OBJECT Thisform.oLV.ListItems.ADD( ,lcImgKey+SYS(2015), JUSTFNAME(lcFile), lnIndexLarge, lnIndexSmall) loIconBuddy = .NULL. llOK = .T. ELSE llOK = .F. ENDIF ENDIF RETURN llOK