MindJet 2016: Custom properties in macro

  • 1
  • Problem
  • Updated 5 years ago
Topic has custom property "Status" defined with "Execution" value filled. Topic is referenced as "tr" object in macro

1. I get empty string if I use tr.DataContainer.CustomProperties.GetCustomPropertyValue("Status")

2. I get (&H80004005) Error: 'Invalid argument') error in I try to set it up with tr.DataContainer.CustomProperties.SetCustomPropertyValue ("Status","any-text")

3. But I see <ap:CustomProperty ... CustomPropertyName="Status" ...> present (with right value <ap:CustomPropertyValue Text="Execution"...>) if I use Debug.Print

Any help appreciated.
Photo of David Dostal

David Dostal

  • 2 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 1
Photo of Nigel Goult (Olympic)

Nigel Goult (Olympic)

  • 358 Posts
  • 142 Reply Likes

You need to get the property first:

	Dim cProperty As CustomProperty
    	For Each cProperty In t.DataContainer.CustomProperties.CustomPropertyCollection
        	If cProperty.CustomPropertyName = "My Property" Then
            		'Work with the Property
        	End If
Hope this helps you out.


MAP  - Become a MindManager Power User FAST! Now with extended license plans for Enterprise and Education - Learn more at www.mapformindmanager.com
Photo of David Dostal

David Dostal

  • 2 Posts
  • 0 Reply Likes

Nigel, works perfectly, many thanks.

I was completely newbie-mistaken - used to work with CustomAttributes collection instead of CustomProperty :)