Create Topic in Macro using Topics.Add() method

  • 1
  • Question
  • Updated 3 years ago
I am trying to create a new topic within a macro using the Topics.Add() method, but I can't seem to find the right syntax. I keep getting an error when I tried to do it - and the syntax doesn't show up in the autocomplete, which says to me that I am not doing it right.

Here is the code:

'Only process the map as long as it instantiated.
If Not p_objActiveMap Is Nothing Then
'Get the root topic reference.
Set p_objRootTopic = p_objActiveMap.CentralTopic

'Process the child topics.
Call ParseChildren(p_objRootTopic)

'Indicate status
MsgBox("Processing is complete. " & p_intProcessedTopicCount & " topics processed. " & p_intChangedTopics & " were changed.", vbInformation,"Notification")

''Add a debug output node to the parent.
'Dim objDebugTopic As New Topic
'objDebugTopic.Text= "Final report: Finished processing at "

''This works!
'p_objRootTopic.AddSubTopic("Finished at " & CStr(Now))

Dim objDebugTopic As New Topic
objDebugTopic.Title = "Final report: Finished processing at "

'This should work, but doesn't
End If

The code below the "This should work, but doesn't" SHOULD work, but I can't get it to. I just want to use the Topics.Add() method because I need to set various properties and such on the Topic before it is added to the map and I don't know how to accomplish it any other way.

Any thoughts anyone? Thanks in advance!
Photo of Mike Danielski

Mike Danielski

  • 191 Posts
  • 6 Reply Likes

Posted 3 years ago

  • 1

Be the first to post a reply!