To issues with Export as Image via macro
Discussion Open
Via File / Export / Image I can export a complete mind map as a file in different formats. Via the macro facility I can not only automate this action, but also specify it in more detail. For example, I can indicate which topics (and subtopics) end up in my image.
In a random mind map I select one of the subtopics and start the next macro.
'#Language "WWB-COM" Option Explicit Sub Main Dim cTopic As Topic Dim cDoc As Document Set cDoc = ActiveDocument Set cTopic = cDoc.CentralTopic cDoc.SaveAs("G:\My Drive\2024\sofos\maintenance\mindmanager\xxx.mmap") Set cTopic = cDoc.Selection.PrimaryTopic cDoc.GraphicExport.Reset() cDoc.GraphicExport.AddTopic(cTopic) cDoc.GraphicExport.ExportZoomed("G:\My Drive\2024\sofos\maintenance\mindmanager\xxxpng.png",mmGraphicTypePng, 0, True, 0, 0) cDoc.GraphicExport.ExportZoomed("G:\My Drive\2024\sofos\maintenance\mindmanager\xxxjpg.jpg",mmGraphicTypeJpeg, 0, True, 0, 0) cDoc.GraphicExport.ExportZoomed("G:\My Drive\2024\sofos\maintenance\mindmanager\xxxbmp.bmp",mmGraphicTypeBmp, 0, True, 0, 0) cDoc.GraphicExport.ExportZoomed("G:\My Drive\2024\sofos\maintenance\mindmanager\xxxemf.emf",mmGraphicTypeEmf, 0, True, 0, 0) cDoc.GraphicExport.ExportZoomed("G:\My Drive\2024\sofos\maintenance\mindmanager\xxxgif.gif",mmGraphicTypeGif, 0, True, 0,0) ' cDoc.Save() End Sub
There are two problems:
1. MM ignores my selection but creates an image of the complete mind map.
2. The EMF image appears to be incorrect. When I want to open it, it always gives an error message "This is not a valid bitmap file, or its format is not currently supported."
Please, advice.
---