OnBeforePublish Event

Microsoft FrontPage Visual Basic

OnBeforePublish Event

Occurs before a Web site is published.

Private Sub expression_OnBeforePublish(Destination As String, Cancel As Boolean)

expression     A variable name which references an object of type WebEx declared using the WithEvents keyword in a class module.

Destination     A String that specifies the URL of the published Web site.

Cancel       A Boolean that specifies whether to cancel the publish operation. True cancels publishing the Web site.

Remarks

This event can be cancelled.

Example

The following example displays a message to the user before a Web site is published. It also allows the user to cancel the event before it occurs.

Private Sub expression_OnBeforePublish(Destination As String, Cancel As Boolean)
'Occurs before a web is published.

    Dim blnAns As Boolean

    blnAns = MsgBox _
        ("Are you sure you want to publish to the following destination: " & _
            Destination)
    If blnAns = False Then
        Cancel = True
    Else
        Cancel = False
    End If

End Sub