Use a topic property (url) to add a link to the topic using a Macro?

  • 1
  • Question
  • Updated 2 weeks ago
I have a CSV file that I have pulled from a database. When I construct a map by using the CSV as a database,  one of the imported properties for each topic is a url (http://.... etc.) is it possible to run a Macro to use these topic properties to add a link to each topic using this property value?
Photo of Simon Philpott

Simon Philpott

  • 1 Post
  • 0 Reply Likes

Posted 4 weeks ago

  • 1
Photo of Alex Gooding

Alex Gooding, Champion

  • 1085 Posts
  • 262 Reply Likes
You can probably do this via a macro but there is an alternative which doesn't require one, assuming the table isn't too complex. This method does require Word and, ideally, Excel.

A few weeks ago I posted a response to a question on how to extract web links as URLs from a table with links on a website: https://community.mindjet.com/mindjet/topics/is-it-possible-to-create-a-map-from-a-list-of-items-wit... I've also posted a more detailed description on my blog: https://sociamind.com/2019/10/16/mind-mapping-the-world-wide-web-one-page-at-a-time/

This approach can be adapted to work with CSV files, except obviously you don't have to extract the data from a website first. The method involves the export of a dummy Word file from MindManager to capture the MM topic styles as Word styles which can then be used to format the table before importing it into MindManager. Rather than explain it all again here I suggest you look at the post where the steps are outlined.



Photo of Simon Philpott

Simon Philpott

  • 2 Posts
  • 1 Reply Like
Hi, I actually had success with Macro in the end, despite the awful documentation for MM unique VB


Dim allTopics As Topic
Dim topicURL As String
For Each allTopics In ActiveDocument.Range(mmRangeAllTopics, True)
If allTopics.DataContainer.DataContainerType <> mmDataContainerTypeNone Then
topicURL= allTopics.DataContainer.CustomProperties.GetCustomPropertyValue("URL")
If allTopics.HasHyperlink Then
Else
allTopics.CreateHyperlink(topicURL) 
End If
End If 
Next
(Edited)