'#Reference {A3B5C45B-F842-44fc-A5E5-50CED69BA86E}#2.0#0#C:\Program Files\Mindjet\MindManager 6\Mm5WebExport.dll#Mm5webexport 2.0 Type Library
'#Uses "GlobalParameterNames.mmbas"
'#Uses "GlobalUtilities.mmbas"
'#Uses "ParameterNames.mmbas"

Option Explicit

Sub Main
    Dim m_Addin As Mm5WebExportAddIn
    Dim m_Webex As WebExport
    Dim m_Doc As Document

    Set m_Addin = WebExportHelper.WebExportAddIn
    Set m_Webex = m_Addin.ActiveWebExport

    On Error GoTo ReportError

    m_Webex.Trace("Entering BeginExport", 2)

    Set m_Doc = m_Webex.Document

    ' Parameter initialization (needed to prevent errors when the map has no sub topics)
    m_Webex.SetParameter("CustomParameter.MapName", VerifyTopicText(m_Webex, m_Doc.CentralTopic))
    m_Webex.SetParameter("CustomParameter.CentralTopicText", "")
    'm_Webex.SetParameter("CustomParameter.NumberOfImageMaps", 1)
    'm_Webex.SetParameter("CustomParameter.ImageCounter", 0)

    'm_Webex.AssurePathExists(m_Webex.FullExportFilename(m_Webex.GetParameter(TdFolderMapMarkers))) ' Needed?
    m_Webex.VariantSets(weVariantSetTopics).RemoveAll()
    m_Webex.VariantSets(weVariantSetIcons).RemoveAll()
    
    m_Webex.Trace("Exiting BeginExport", 2)
    
    Exit Sub
   
ReportError:
    ProcessError(m_Webex)
    Exit Sub
   
End Sub
