RemoveWeb Method

       

Removes the WebEx object from the specified WebFolder object.

expression.RemoveWeb(UserName, Password)

expression   An expression that returns a WebFolder object.

UserName   Optional String. The logon name of the user.

Password   Optional String. The password of the user.

Remarks

The RemoveWeb method is the complement of the MakeWeb method. Just as the MakeWeb method creates the meta data for the web from a folder, the RemoveWeb method removes the meta data for the web from a folder, but the folder remains intact. This is different from the Delete method for the WebEx object, where the entire contents of the specified web are removed.

Example

This example removes a web from a folder. The folder and its contents remain intact, but the folder is no longer a web.

Note   You must have the web that contains the folder open.

Private Sub WebRemove()
    Dim myFolders As WebFolders
    Dim myFolder As WebFolder

    Set myWebFolders = Webs(0).RootFolder.Folders

    For Each myFolder In myFolders
        If myFolder.Name = "TempWeb" Then
            myFolder.RemoveWeb
            Exit For
        End If
    Next
End Sub