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.
fpDepsDefault | Removes all images, link bars, hyperlinks, lists, shared borders, and themes. |
fpDepsImages | Removes all images. |
fpDepsLinkbars | Removes all link bars. |
fpDepsLinks | Removes all pages to which there are hyperlinks. |
fpDepsLists | Removes lists that may be needed in order for the page to render correctly. |
fpDepsNone | Removes no dependencies. |
fpDepsRecurse | Removes all files that are in a specified folder. |
fpDepsSharedBorders | Removes all shared borders. |
fpDepsThemes | Removes 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