WebPackage Object
WebPackage |
Represents a Web package that has been created in Microsoft FrontPage Visual Basic for Applications. The WebPackage object is an in-memory object only and does not correspond to any FrontPage User Interface element. Instead, use the WebPackage object to work with a Web package once you've created it in code.
Using the WebPackage object
Use the CreatePackage method to create a WebPackage object. The following example creates a new Web package.
Dim objPackage As WebPackage
Set objPackage = ActiveWeb.CreatePackage("New Web Package")
Use the Add method to add files to the Web package. The following example adds three files to the WebPackage object created in the previous code.
objPackage.Add objWeb.Url & "/test.htm", fpDepsDefault
objPackage.Add objWeb.Url & "/test2.htm", fpDepsNone
objPackage.Add objWeb.Url & "/test3.htm", fpDepsImages
Use the Subject, Author, Comany, and Title properties to add information about a Web package. The following example specifies the subject, author, and company for the WebPackage object created above. (When you create a Web package, the Title parameter for the CreatePackage method becomes the value of the Title property. You can change the title of a Web package by setting the Title property to a new value.)
objPackage.Author = "John Smith"
objPackage.Company = "Fourth Coffee"
objPackage.Subject = "This is a new Web package for Fourth Coffee."
Use the Remove method to remove files that were added by using the Add method. The following example removes one of the files added above.
objPackage.Remove objWeb.Url & "/test3.htm", fpDepsImages
Use the Save method to save, or export, a Web package. The following example saves the WebPackage object created above.
objPackage.Save "c:\NewWebPackage.fwp", True
Properties | Application Property | Author Property | Company Property | Subject Property | Title Property
Methods | Add Method | Remove Method | Save Method
Parent Objects
Child Objects