Send Topics To... in order to Microsoft Word

Michael S. shared this question 3 years ago
Answered

How do I send selected (right-click Send Topic(s) to Word) topics to Microsoft Word and have them appear in the Word document in order. I know that if I do a conventional export of the map to Word, will work. But the order is Not maintained when using the Send Topics to Word on selected topics.


Can anybody give me direction as to whether or not there is a VBA object ID number of some kind that points to a topic's numerical position within a map?

Replies (1)

photo
2

Hello Michael. I don't know the answer to the first question. But regarding topic IDs, I believe the full topic collection returned by Document.Range(mmRangeAllTopics) is in the order that the topics were created, which is not very useful. There is no built-in map order coded on the topics themselves, and the Guid gives no clue. But if you are prepared to apply topic numbering in the map, you could read the numbering prefix from topics using Topic.Title.GetDisplayText(MmDisplayTextFlags.mmDisplayTextNumberPrefix) and use that to sort into map order.

photo
1

Hello Nick. Thank you for such a quick response and the direction towards solving my issue using VBA & topic numbering (very valuable!).

From your status, I can see that you are MindManager Expert, I wonder if you would agree that surely the result of Send Topic to Word should be the same as Export Map to Word (in regards to the order of the topics in the resulting Word doc) maybe others would agree?


Thank you again for your response and direction


Michael

photo
1

Hello Michael. I have not actually tried this process so am guessing a bit. Is it possible that they are being sent to Word in the order that they were selected? I know the selection order is important for some functions (such as aligning topics, where the primary one is the last one selected).

photo
1

Hi Nick,


I created a simple mind map with just a central topic and 3 topics made in the order and with the titles of "red", "yellow", "green".


Then by following your suggestion, further testing has indeed revealed that not only is it the order in which you select the topics that will define the order produced in the Word document. But also from which direction you select the topics when using the mouse to select them.


Therefore somewhere deep within MindManager, there must be somewhere (I would assume an array) where the order is recorded.


One more question:

Is there a better way to count the number of selected topics in the current mind map? I am doing the following:

For Each currentTopic In MMapp.ActiveDocument.Range(mmRangeAllTopics)

If currentTopic.IsSelected Then

numberOfSelectedTopics = numberOfSelectedTopics + 1

Else

'Do nothing

End If

Next currentTopic


Thank you for your help

photo
1

I think if you use the lasso to select topics, then they will be added in the order that the lasso captures them.

Yes, there is a quicker way to find all selected topics without traversing the whole map, which could be pretty slow for a large map. The Document object has a Selection object that contains all selected objects, which includes Topics alongside other objects such as Relationships. This uses the base type DocumentObject. If any topics are selected, then Document.Selection.PrimaryTopic will be a valid pointer.

The forum software has stripped indentation below.

Function TopicsCountSelected As Integer

Dim m_DocumentObject As DocumentObject

TopicsCountSelected = 0

If Not (ActiveDocument Is Nothing) Then

If Not (ActiveDocument.Selection.PrimaryTopic Is Nothing) Then

For Each m_DocumentObject In ActiveDocument.Selection

If m_DocumentObject.Type = mmDocumentObjectTypeTopic Then

TopicsCountSelected = TopicsCountSelected + 1

End If

Next

End If

End If

End Function


If you need to work with a selected object as a topic, just cast it to a Topic object with

Dim m_Topic as Topic

Set m_Topic = m_DocumentObject

photo
1

Thank you Nick, and your numbering suggestion helped immensely.

---