WORKS!
You need a form object with an ImageList called "temp_IL" then add following code:
Function GetIcon _
(ByVal Pic As StdPicture, _
ByVal BackColor&, _
Optional ByVal UseMask As Boolean, _
Optional ByVal MaskColor&) As StdPicture
If Pic = 0 Then Exit Function
On Error GoTo 10
With temp_IL
.ListImages.Clear
.ImageHeight = ScaleX(Pic.Height, vbHimetric, vbPixels)
.ImageWidth = ScaleY(Pic.Width, vbHimetric, vbPixels)
.BackColor = BackColor
.MaskColor = MaskColor
.UseMaskColor = UseMask
Set GetIcon = .ListImages.Add(, , Pic).ExtractIcon
' .ListImages.Clear
End With
Exit Function
10:
If Err.Number = 0 Then ' No Error
Resume Next
ElseIf Err.Number = 20 Then ' Resume Without Error
Err.Clear
Resume Next
Else ' Other Error
Err.Clear
End If
End Function
Right lads.
Cheers, Charlie