CreatePackage Method

Microsoft FrontPage Visual Basic

CreatePackage Method

Returns a WebPackage object that represents a collection of pages, files, and folders and their related dependencies, such as images, cascading style sheets, and JavaScript files.

expression.CreatePackage(Title)

expression    Required. An expression that returns a WebEx object.

Title    Required String. The name of the Web package. This value becomes the value of the Title property for the WebPackage object.

Remarks

Use the CreatePackage method to create the WebPackage object. Use the Add method to add pages to the Web package. Then use the Save method to save the new Web package to disk. Use the Remove method to remove files that were added by using the Add method.

You can create Web packages from files in Web sites based on Microsoft Windows SharePoint Services and in disk-based Web sites.

Example

The following example creates a new Web package and adds the page "test.htm" to the package, including all dependencies for the page, and then saves the new Web package.

    Dim objWeb As WebEx
Dim objPackage As WebPackage

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

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