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

Option Explicit

Sub Main

    Dim addin As Mm5WebExportAddIn
    Dim webex As WebExport

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

    Dim template As String

    On Error GoTo ReportError

    webex.Trace("Entering GeneratePage", 2)

    ' Use central topic text as the page title
    webex.SetParameter(TcpPageTitle, _
                       VerifyTopicText(webex, webex.ActivePage.GetTopic(1)))

    ' Load the root HTML page
    template = webex.ReadFile("Page.htm")

    ProcessString webex, template
    webex.WriteFile(webex.ActivePage.Filename, template)

    webex.Trace("Exiting GeneratePage", 2)
    
    Exit Sub
   
ReportError:
    ProcessError(webex)
    Exit Sub
   
End Sub
