OFFICESE: How to List the Subject of a Discussion in an Office Document

ID: Q247573


The information in this article applies to:
  • Microsoft Office 2000 Server Extensions
  • Microsoft Excel 2000
  • Microsoft Word 2000
  • Microsoft PowerPoint 2000


SUMMARY

In Microsoft Office, the Microsoft Office Server Extensions (OSE) library enables 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.


MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp

NOTE: You must add a reference to the OSE Object model. To do this, follow these steps:
  1. Start the Visual Basic Editor (VBE) by pressing ALT+F11 from within one of the Office programs.


  2. On the Tools menu, click References.


  3. In the Available References list box, select the Microsoft Office Server Extensions 1.0 Object Library check box.


  4. Click OK.




Sub ListSubjects()

'setup variables
Dim dscDiscussions As Discussions
Dim dscDiscussionItem As Discussion
Dim strURLPath As String, strFileName As String, strThreads As String
Dim intCurT As Integer

'initialize counter and strings to identify server and document on server
intCurT = 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 server
Set dscDiscussions = OpenDiscussions(strURLPath & strFileName)

'loop through each discussion thread on server
For Each dscDiscussionItem In dscDiscussions
    strThreads = strThreads & "Discussion " & intCurT & " : " & _
        dscDiscussionItem.Subject & Chr(10)
    intCurT = intCurT + 1
Next dscDiscussionItem

'display a message box with count of discussions and their _
respective titles
MsgBox "Number of Discussions on " & strFileName & ": " & _
    dscDiscussions.Count & Chr(10) & Chr(10) & strThreads
End Sub 

Additional query words: XL2000 OSE OFF2000 oseclient focusteam

Keywords : kbdta kbdtacode OffVBA KbVBA
Version : WINDOWS:2000; winnt:
Platform : WINDOWS winnt
Issue type : kbhowto


Last Reviewed: December 14, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.