TMGR: How to Use Views via OLE Automation

ID: Q151139

The information in this article applies to:

SUMMARY

Working with Microsoft Team Manager views via OLE Automation is identical to accessing collections.

MORE INFORMATION

Microsoft Team Manager views are a collection of all View objects within the team file. As a collection, they are accessed through OLE Automation in the standard method that collections can be accessed. The following Visual Basic code is an example of this.

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 the Microsoft fee-based consulting line at (800) 936-5200. 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/refguide/default.asp

Sub FindAllViews()
     Set oTmgr = GetObject(, "TeamManager.Application")
     For Each View In oTmgr.Views
          MsgBox View.Name
     Next
End Sub

This sample iterates through each view in the team file, and displays the view's name in a message box.

REFERENCES

For more information about using collections and loops see the following:

Visual Basic 4.0, "Programmer's Guide," Chapter 5, "Programming Fundamentals -- Loop structures," pages 138 - 144 and Chapter 7, "Introduction to Objects -- Using Visual Basic Collection Objects," pages 217 - 221

Microsoft Excel for Windows, version 5.0, "Visual Basic User's Guide," Chapter 5, "Working with Objects in Visual Basic --Working with Collections of Objects," pages 73 - 75, and Chapter 7, "Controlling How Your Code Runs --Looping," pages 146 - 147

Additional query words: 1.00 97

Keywords          : kbole kbprg kbdta kbdtacode 
Version           : WINDOWS:97
Platform          : WINDOWS

Last Reviewed: May 19, 1999