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

Sub Main

    Dim addin As Mm5WebExportAddIn
    Dim webex As WebExport
    Dim aPage As Mm5WebExportLib.Page

    Set addin = WebExportHelper.WebExportAddIn
    Set webex = addin.ActiveWebExport
    Set aPage = webex.ActivePage

    Dim oneTopic As Topic

    Dim count As Long
    Dim i As Long
    Dim template As String
    Dim topicString As String
    Dim bodyString As String


    On Error GoTo ReportError
    webex.Trace("Entering BoxRe.mmbas",2)

    Set oneTopic = webex.ActiveTopic

    ' Detect if there are any items to export
    If    DoExportRelatedSection_Links(oneTopic, webex) _
       Or DoExportRelatedSection_Callouts(oneTopic, webex) Then

        ' Read template file
        template = webex.ReadFile( "BoxRe.htm" )

        topicString = template

        ' Process all commands and parameters
        ProcessString webex, topicString

        ' Store our processed review comments
        bodyString = topicString

    Else

         ' Nothing to export
         bodyString = ""

    End If

    ' Write out the result
    webex.PushString(bodyString)

    webex.Trace("Exiting BoxRe.mmbas", 2)

    Exit Sub

ReportError:
    ProcessError(webex)
    Exit Sub

End Sub
