- Option Explicit
- Private WithEvents objMessenger As MessengerAPI.Messenger
-
- Private Sub Form_Load()
- Set objMessenger = New MessengerAPI.Messenger
- End Sub
-
- Private Sub objMessenger_OnIMWindowDestroyed(ByVal pIMWindow As Object)
- Dim MsgrIMWindow As IMessengerConversationWnd
- Dim MsgrContacts As IMessengerContacts
- Dim i As Long
- Dim fil As Integer
- Dim strTmpText As String
-
- Set MsgrIMWindow = pIMWindow
- Set MsgrContacts = MsgrIMWindow.Contacts
-
- If MsgrContacts.Count = 0 Then
- strTmpText = "test"
- Else
- strTmpText = MsgrContacts.Item(0).SigninName
- End If
-
- fil = FreeFile()
- Open "C:\test\" & strTmpText & ".log" For Append As #fil
- Print #fil, "_______________________________________________________________________________________"
- Print #fil, "Le " & Date & " a " & Time
- Print #fil, "Contact dans la conversation (" & MsgrContacts.Count & "): "
- For i = 0 To MsgrContacts.Count - 1
- Print #fil, " - " & MsgrContacts.Item(i).FriendlyName & "<" & MsgrContacts.Item(0).SigninName & ">"
- Next
- Print #fil, "---------------------------------------------------------------------------------------"
- Print #fil, MsgrIMWindow.History
- Print #fil, "_______________________________________________________________________________________" & vbCrLf
- Close #fil
- End Sub
-
Option Explicit
Private WithEvents objMessenger As MessengerAPI.Messenger
Private Sub Form_Load()
Set objMessenger = New MessengerAPI.Messenger
End Sub
Private Sub objMessenger_OnIMWindowDestroyed(ByVal pIMWindow As Object)
Dim MsgrIMWindow As IMessengerConversationWnd
Dim MsgrContacts As IMessengerContacts
Dim i As Long
Dim fil As Integer
Dim strTmpText As String
Set MsgrIMWindow = pIMWindow
Set MsgrContacts = MsgrIMWindow.Contacts
If MsgrContacts.Count = 0 Then
strTmpText = "test"
Else
strTmpText = MsgrContacts.Item(0).SigninName
End If
fil = FreeFile()
Open "C:\test\" & strTmpText & ".log" For Append As #fil
Print #fil, "_______________________________________________________________________________________"
Print #fil, "Le " & Date & " a " & Time
Print #fil, "Contact dans la conversation (" & MsgrContacts.Count & "): "
For i = 0 To MsgrContacts.Count - 1
Print #fil, " - " & MsgrContacts.Item(i).FriendlyName & "<" & MsgrContacts.Item(0).SigninName & ">"
Next
Print #fil, "---------------------------------------------------------------------------------------"
Print #fil, MsgrIMWindow.History
Print #fil, "_______________________________________________________________________________________" & vbCrLf
Close #fil
End Sub