Export map as image from VBA-macro?

  • 1
  • Question
  • Updated 9 months ago
Is it possible to export mindmaps to image files from a VBA-macro?
It is possible from File->Export, however I need to automate the task.

http://onlinehelp.mindjet.com/help/Mindmanager/17/EN/export_maps.htm#Export_the_map_as_an_image_file
Photo of Lars H

Lars H

  • 1 Post
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of Nick Duffill

Nick Duffill, Champion

  • 515 Posts
  • 172 Reply Likes
The Document object contains a "GraphicExport" object that handles graphic exports. You can add topics to it then run the export method to produce an image file. There are many options to experiment with. Try this:
Sub Main
    With ActiveDocument
        .GraphicExport.Reset
        .GraphicExport.AddTopic(.CentralTopic)
        .GraphicExport.ExportSized("C:\Temp\central topic export.png",mmGraphicTypePng, 1000, 1000)
    End With
End Sub
(Edited)
Photo of Nick Duffill

Nick Duffill, Champion

  • 515 Posts
  • 172 Reply Likes
Update: the above works for MindManager 2017, but some problems have been seen with MindManager 2018 when exporting individual topics. The export of the whole map works though.
Photo of Andrey Kazak

Andrey Kazak

  • 51 Posts
  • 5 Reply Likes
Dear Nick,

  What are the problems with exporting individual topics from MM 2018?
  Thank you.
Photo of Andrey Kazak

Andrey Kazak

  • 51 Posts
  • 5 Reply Likes
I try to get size of and exported image in MM 18.1.154.
The following piece of code:
Dim pWidth As Long
Dim pHeight As Long
pWidth = 100
pHeight = 100
...
.GraphicExport.GetImageSize(pWidth,pHeight)
Debug.Print "Image size is " + CStr(pWidth) + " × " + CStr(pHeight)

returns
Image size is 0 × 0
What am I doing wrong?
(Edited)
Photo of Andrey Kazak

Andrey Kazak

  • 51 Posts
  • 5 Reply Likes
Can you share an update on the topic please?