TermStore.GetTerms method (Guid[])

Gets a collection of Term objects based on the ID of the Term.

Namespace:  Microsoft.SharePoint.Taxonomy
Assembly:  Microsoft.SharePoint.Taxonomy (in Microsoft.SharePoint.Taxonomy.dll)

public TermCollection GetTerms(
	Guid[] termIds


Type: []

The IDs of the Term objects to be retrieved

Return value

Type: Microsoft.SharePoint.Taxonomy.TermCollection
A collection of Term objects that are based on the ID of the Term, or an empty collection or a null reference (Nothing in Visual Basic) if no terms match.


The termIds parameter cannot be a null reference (Nothing in Visual Basic).

If a Term is a member of multiple TermSet objects, it arbitrarily returns the Term from one of the TermSet objects. If an ID from termIds cannot be matched against the ID of a term in this TermStore object or if the user does not have sufficient permissions to access it, the term will not be included in the result collection that is returned. This method searches for the Term across all of the child groups and term sets that the user has permissions to read.

If the termIds list contains duplicate IDs, the returned item collection also contains duplicates. If this search finds no terms, then either a null reference (Nothing in Visual Basic) or an empty collection will be returned.