Attribute VB_Name = "modSmilies"
Option Explicit

Public Sub LoadEmoticons(File As String)
On Error GoTo hErr:
    If LenB(File) = 0 Then Exit Sub
1   Dim FF As Integer, LN As String, S() As String, FSO As New FileSystemObject
2   frmBot.imlSmiley.ListImages.Clear
    FF = FreeFile
3   Open AppData & "Emoticons\" & File & ".ini" For Append As #FF: Close #FF
4   Open AppData & "Emoticons\" & File & ".ini" For Input As #FF
    frmBot.imlSmiley.Tag = File
5   Do Until EOF(FF) Or Err
6       Line Input #FF, LN
7       If InStr(LN, "#") > 0 Then
8           S = Split(LN, "#", 2)
9           If FSO.FileExists(AppData & "Emoticons\" & File & "\" & S(0)) Then
10              With frmBot.imlSmiley.ListImages.Add(, , LoadPicture(AppData & "Emoticons\" & File & "\" & S(0)))
11                  .Tag = S(1)
12              End With
13          End If
14      End If
15  Loop
16  Close #FF
    Exit Sub
hErr:
    ErrorHandler Err.Number, Err.Description, Erl, "Emoticons", "LoadEmoticons"
End Sub
