This article was previously published under Q247573
This article has been archived. It is offered "as is" and will no longer be updated.
In Microsoft Office, the Microsoft Office Server Extensions (OSE) library allows you to programmatically control objects in Discussions and DiscussionServers collections. You can use the Subject property of the Discussion object to return the title of discussions in a document that is hosted on a Web server extended with Microsoft Office 2000 Server Extensions.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. NOTE: You must add a reference to the OSE Object model. To do this, follow these steps:
Start the Visual Basic Editor (VBE) by pressing ALT+F11 from within one of the Office programs.
On the Tools menu, click References.
In the Available References list box, select the Microsoft Office Server Extensions 1.0 Object Library check box.
Sub ListSubjects()'setup variablesDim dscDiscussions As DiscussionsDim dscDiscussionItem As DiscussionDim strURLPath As String, strFileName As String, strThreads As StringDim intCurT As Integer'initialize counter and strings to identify server and document on serverintCurT = 1'<OSEWebServerName> is the name of the Discussion Server _ where the document is stored.strURLPath = "http://<OSEWebServerName>/"'<DocumentName> is the name of the document.strFileName = "<DocumentName>"'open the discussions on the serverSet dscDiscussions = OpenDiscussions(strURLPath & strFileName)'loop through each discussion thread on serverFor Each dscDiscussionItem In dscDiscussions strThreads = strThreads & "Discussion " & intCurT & " : " & _ dscDiscussionItem.Subject & Chr(10) intCurT = intCurT + 1Next dscDiscussionItem'display a message box with count of discussions and their _respective titlesMsgBox "Number of Discussions on " & strFileName & ": " & _ dscDiscussions.Count & Chr(10) & Chr(10) & strThreadsEnd Sub