AddIn. C#. How to get a collection of selected topics?

  • 1
  • Question
  • Updated 10 months ago
I want to develop an add-in in C#.

How can I get a collection of selected topics?
In other words, I want to get:
Topic_1
Topic_1_1
Topic_1_2
Topic_1_3

Photo of Ivan

Ivan

  • 51 Posts
  • 1 Reply Like

Posted 1 year ago

  • 1
Photo of Andreas Vogt

Andreas Vogt

  • 2 Posts
  • 0 Reply Likes
Each document has a selection property 
that contains a collection of selected objects.

Example Macro in MM:

Dim I As Integer Dim aDocObj As DocumentObject Dim aTopic As Topic For I = 1 To ActiveDocument.Selection.Count Set aDocObj = ActiveDocument.Selection.Item(I) If aDocObj.Type = mmDocumentObjectTypeTopic Then Set aTopic = aDocObj aTopic.FillColor.SetARGB(255,128,255,128) End If Next

(Edited)