TMGR: How to Use Views via OLE Automation (151139)



The information in this article applies to:

  • Microsoft Team Manager

This article was previously published under Q151139

SUMMARY

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

MORE INFORMATION

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. 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.
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

Modification Type:MinorLast Reviewed:8/17/2005
Keywords:kbdtacode kbProgramming KB151139