Remove Method (Web Object Model)

Microsoft FrontPage Visual Basic

Show All Show All

Remove Method (Web Object Model)

Returns a Boolean that represents whether a specified file was successfully removed from a Web package.

expression.Remove(Url, flags)

expression    Required. An expression that returns one of the objects in the Applies To list.

Url    Required String. The path and file name of the file to remove from the Web package.

flags    Required FpDependencyFlags. Specifies which dependencies to include when removing the Web package.

FpDependencyFlags can be a combination of one or more of the following FpDependencyFlags constants.

fpDepsDefaultRemoves all images, link bars, hyperlinks, lists, shared borders, and themes.
fpDepsImagesRemoves all images.
fpDepsLinkbarsRemoves all link bars.
fpDepsLinksRemoves all pages to which there are hyperlinks.
fpDepsListsRemoves lists that may be needed in order for the page to render correctly.
fpDepsNoneRemoves no dependencies.
fpDepsRecurseRemoves all files that are in a specified folder.
fpDepsSharedBordersRemoves all shared borders.
fpDepsThemesRemoves all themes.

Example

The following example creates a Web package and adds three files to it, removes the last file added to the package, and then saves the package to the local drive.

    Set objWeb = ActiveWeb
Set objPackage = objWeb.CreatePackage("New Web Package")

With objPackage
    .Add objWeb.Url & "/test.htm", fpDepsDefault
    .Add objWeb.Url & "/test2.htm", fpDepsNone
    .Add objWeb.Url & "/test3.htm", fpDepsImages
    
    .Remove objWeb.Url & "/test3.htm", fpDepsImages
    
    .Author = "John Smith"
    .Company = "Fourth Coffee"
    .Subject = "This is a new Web package for Fourth Coffee."
    
    .Save "c:\NewWebPackage.fwp", True
End With