Understanding Discussion Servers

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The DiscussionServers collection contains all the DiscussionServer objects that represent each discussion server registered on your machine. You can view this collection in the Select a Discussion server box in the Discussion Options dialog box (shown in the following figure). A DiscussionServer object is used to store discussion items for any document. Typically, a workgroup would agree to use a specific discussion server, so all members of the group will be able to see each other's comments.

You use the DiscussionServers collection's Add method to add a new DiscussionServer object to the list of discussion servers registered on your machine. The Add method requires values for both the ServerAddress and the FriendlyName arguments. These arguments map directly to the settings you provide in the Add or Edit Discussion Servers dialog box, which you open by clicking the Add or Edit button in the Discussion Options dialog box. The default discussion server is represented by the DiscussionServers(1) DiscussionServer object. You can make any DiscussionServer object the default by using the object's SetAsDefault method, which re-sorts the collection of DiscussionServer objects. You remove a DiscussionServer object by using the object's Delete method.

The following code shows how to determine the number of discussion servers registered on the current machine:

Sub DisplayDiscussionServerInfo()
   Dim strCountMessage        As String
   Dim strServerInfo          As String
   Dim dscCurrentServer       As DiscussionServer

   strCountMessage = "There are " & OSE.DiscussionServers.Count _
      & " discussion servers registered on this machine." & vbCrLf
   If OSE.DiscussionServers.Count > 0 Then
      For Each dscCurrentServer In OSE.DiscussionServers
         With dscCurrentServer
            strServerInfo = strServerInfo & "Name = " & .FriendlyName _
               & ", Address = " & .ServerAddress & "." & vbCrLf
         End With
      Next dscCurrentServer
   Else
      strServerInfo = ""
   End If
   MsgBox strCountMessage & strServerInfo
End Sub

See Also

Using Web Technologies with Office XP | Working with Office Web Discussions Client | The Office Web Discussions Client Object Model | Enabling Discussions | Understanding the Global Object | Understanding Discussions | Understanding Subscriptions