MindManager Object Model v20.0.334
Range Collection

The Range collection is one of the three basic ways to access the contents of a map (the others being to traverse the map hierarchically starting with the Central Topic, or to use the TopicFinder object to search for and return specific Topics).

A Range is a set of DocumentObject objects in the current document which meet specific criteria. Ranges can be assembled by object type and whether or not the items are filtered out of view with an active filter. The Range is created dynamically by the Document.Range method and is a snapshot of the document content at the time. If an item in the Range is later deleted, the Range is not automatically refreshed, but must be regenerated.

Note that the order of items returned in the Range is not deterministic, but is typically the order in which they were added to the map, which is rarely useful. A Range cannot be used to process a map in any order that relates to the structure of the map.

While there are other ways to access the Topics in a map, the Range is the only way to access all Boundaries or all Relationships in a map.

Object Model
Range CollectionDocumentObject ObjectCustomAttributes ObjectDocument Object
To use the document Range to iterate over all the topics in a map, including any filtered-out topics.
Option Explicit

Sub Main
	Dim m_Topic As Topic
	For Each m_Topic In ActiveDocument.Range(mmRangeAllTopics, True)
		' do something with m_Topic
End Sub
The above will work as a macro because it is able to automatically cast the returned DocumentObject objects as Topic objects. In other environments you may need to be more explicit about casting the DocumentObject items in the Range to the required objects for manipulation, as illustrated below in a generic language:
Dim m_DocumentObject as MindManager.Interop.DocumentObject
Dim m_Topic As MindManager.Interop.Topic

For Each m_Topic In ActiveDocument.Range(MindManager.Interop.MmRangeAllTopics, False)
	m_Topic = CType(m_DocumentObject, MindManager.Interop.Topic)
	' do something with m_Topic
See Also

Range Members