IgnoreUsers MethodIgnoreUsers Method*
*Contents  *Index  *Topic Contents
*Previous Topic: Disconnect Method
*Next Topic: KickUser Method

IgnoreUsers Method

Allows the caller to ignore or stop ignoring users.

Syntax

object.IgnoreUsers UserItems, Set

Parameters

objectRequired. An object expression that evaluates to an MsChatPr control.
UserItemsRequired. An object expression that evaluates to a ChatItems object. Allows the caller to set criteria on the user's Nickname, UserName, or IPAddress. The item names that can be used to construct the ChatItems object are:
Nickname
NicknameOp
UserName
UserNameOp
IPAddress
IPAddressOp
SetRequired. A Boolean value used to indicate if a user should be ignored. If set to TRUE, the user is ignored. If set to FALSE, the user is no longer ignored.

Remarks

Ignoring a user means that the caller will no longer receive private messages from the ignored user.

Administrators and system operators are never ignored, even if the caller ignores a group of users that includes an administrator or system operator.

The IgnoredUsers server property returns the list of ignored users in the form of an array of ChatItems objects and is updated each time the user calls the IgnoreUsers method.

Examples

1. Ignore one specific user:

Dim chatitemobj As ChatItems
Set chatitemobj = New ChatItems
chatitemobj.AssociatedType  = "Query"
chatitemobj.Item("Nickname") = "Justin"
chatitemobj.Item("UserName") = "ArthurB"
chatitemobj.Item("IPAddress") = "foo.microsoft.com"
MsChatPr1.IgnoreUsers chatitemobj, True
Set chatitemobj = Nothing

2. Ignore all the users with an IP address that ends with .edu:

Dim chatitemobj As ChatItems
Set chatitemobj = New ChatItems
chatitemobj.AssociatedType  = "Query"
chatitemobj.Item("IPAddressOp") = "EndsWith"
chatitemobj.Item("IPAddress") = ".edu"
MsChatPr1.IgnoreUsers chatitemobj, True
Set chatitemobj = Nothing

3. Stop ignoring the same group:

Dim chatitemobj As ChatItems
Set chatitemobj = New ChatItems
chatitemobj.AssociatedType  = "Query"
chatitemobj.Item("IPAddressOp") = "EndsWith"
chatitemobj.Item("IPAddress") = ".edu"
MsChatPr1.IgnoreUsers chatitemobj, False
Set chatitemobj = Nothing

4. Stop ignoring everybody:

Dim vIgnoredUsers As Variant
Dim chatitemobj As ChatItems
Dim iIndex As Integer
Set chatitemobj = MsChatPr1.ServerProperty("IgnoredUsers")
If (chatitemobj.ItemValid("IgnoredUsers")) Then
    vIgnoredUsers = chatitemobj.Item("IgnoredUsers")
    If (Not IsEmpty(vIgnoredUsers)) Then
        For iIndex = LBound(vIgnoredUsers) To UBound(vIgnoredUsers)
        MsChatPr1.IgnoreUsers vIgnoredUsers(iIndex), False
        Next iIndex
    End If
End If
Set chatitemobj = Nothing 

Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.