Delete Method

       

Delete method as it applies to the NavigationNodes object.

Deletes an individual navigation node from the list of available nodes in the NavigationNodes collection.

expression.Delete(Index)

expression   Required. An expression that returns a NavigationNodes object.

Index  Optional Variant. Refers to an item in the navigation structure. Can be any number corresponding to an item in the navigation structure, with the index starting at zero.

Delete method as it applies to the Properties object.

Deletes a property from the list of available properties in the Properties collection.

expression.Delete(PropertyKey)

expression   Required. An expression that returns a Properties object.

PropertyKey  Required String. A string that represents the property name.

Delete method as it applies to the WebEx object.

Deletes a web from the list of available webs in the Webs collection.

expression.Delete(WebDeleteFlags)

expression   Required. An expression that returns one of the above objects.

WebDeleteFlags  Optional FpWebDeleteFlags. Determines what is deleted from the current web.

FpWebDeleteFlags can be one of these FpWebDeleteFlags constants.
fpDeleteEntireWeb default
fpDeleteFrontPageInfoFromWeb

Delete method as it applies to the WebFiles and WebFolders objects.

Deletes a task from the list of available tasks in the WebFiles collection, or a folder or folders from the list of available folders in the WebFolders collection.

expression.Delete(Index)

expression   Required. An expression that returns one of the above objects.

Index  Required Variant. Refers to an item in the WebFiles or WebFolders collection. Can be any number corresponding to an item in the collection, with the index starting at zero.

Delete method as it applies to the Webs object.

Deletes a web from the list of available webs in the Webs collection.

expression.Delete(Index, WebDeleteFlags)

expression   Required. An expression that returns a Webs object.

Index  Required Variant. Refers to an item in the Webs collection. Can be any number corresponding to an item in the collection, with the index starting at zero.

WebDeleteFlags  Optional FpWebDeleteFlags. Determines what is deleted from the current web.

FpWebDeleteFlags can be one of these FpWebDeleteFlags constants.
fpDeleteEntireWeb default
fpDeleteFrontPageInfoFromWeb

Delete method as it applies to all other objects in the Applies To list. 

Deletes the specified object from a web.

expression.Delete

expression   Required. An expression that returns one of the above objects.

Example

As it applies to the NavigationNodes object.

This example deletes the fourth navigation node of the second file in the active web.

Note   You must apply the navigation structure to the web in order for the changes to be applied to the web.

Private Sub DeleteNavNode()
    Dim myWeb As WebEx
    Dim myChildNodes As NavigationNodes

    Set myWeb = ActiveWeb
    Set myChildNodes = _
        myWeb.RootFolder.WebFiles(1).NavigationNode.Children

    Call myChildNodes.Delete(3)
    myWeb.ApplyNavigationStructure
End Sub

As it applies to the Properties object.

This example deletes the SaleText property from the Sales.htm file.

Private Sub DeleteProperty()
    Dim myFile As WebFile
    Dim myProp As String

    Set myFile = ActiveWeb.RootFolder.Files("Sales.htm")
    myFile.Properties.Delete ("SaleText")
End Sub

As it applies to the WebEx object.

This example deletes a temporary web called TempWeb.

Note   To run this example, you must have a web called "C:\My Documents\My Webs\TempWeb" (for a server running on Microsoft Windows) or "C:\WINNT\Profiles\logon alias\Personal\My Webs\TempWeb" (for a server running on Windows NT). In either case, you may substitute an alternative web URL.

Private Sub DeleteWeb()
    Dim myWeb As WebEx
    Dim myTempWeb As WebEx
    Dim myFolders As WebFolders
    Dim myFolder As WebFolder
    Dim myWebToDelete As String

    Set myWeb = Webs.Open("C:\My Documents\My Webs")
    Set myFolders = myWeb.RootFolder.Folders
    myWebToDelete = "TempWeb"

    For Each myFolder In myFolders
    If myFolder.IsWeb = True Then
        If myFolder.Name = myWebToDelete Then
            Set myTempWeb = Webs.Open(myFolder.Name)
            myTempWeb.Delete
        End If
    End If
    Next
    ActiveWebWindow.Close
End Sub

As it applies to the WebFiles and WebFolders objects.

This statement deletes a file in the active web.

Note   To run this example, you must have a file called "C:\My Documents\My Webs\TempFile.htm" (for a server running on Microsoft Windows) or "C:\WINNT\Profiles\logon alias\Personal\My Webs\TempFile.htm" (for a server running on Windows NT). In either case, you may substitute an alternative web file.

ActiveWeb.RootFolder.Files.Delete "TempFile"

This statement deletes the second folder in the active web.

ActiveWeb.RootFolder.Folders.Delete(1)

As it applies to the Webs object.

This statement deletes the fourth web.

Webs.Delete(3)

As it applies to all other objects in the Applies To list.

This example deletes a file from the active web.

Note   To run this example, you must have a file called "C:\My Documents\My Webs\TempFile.htm" (for a server running on Microsoft Windows) or "C:\WINNT\Profiles\logon alias\Personal\My Webs\TempFile.htm" (for a server running on Windows NT). In either case, you may substitute an alternative web file.

Private Sub DeleteFile()
    Dim myFile As WebFile

    Set myFile = ActiveWeb.RootFolder.Files("TempFile")
    myFile.Delete

End Sub

This example deletes a folder from the active web.

Note   To run this example, you must have a file called "C:\My Documents\My Webs\TempFolder" (for a server running on Microsoft Windows) or "C:\WINNT\Profiles\logon alias\Personal\My Webs\TempFolder" (for a server running on Windows NT). In either case, you may substitute an alternative web folder.

Private Sub DeleteFolder()
    Dim myFolder As WebFolder

    Set myFolder = ActiveWeb.RootFolder.Folders("TempFolder")
    myFolder.Delete

End Sub