ImportWebPackage Method

Microsoft FrontPage Visual Basic

Show All Show All

ImportWebPackage Method

Returns an FpPkgImportResult that represents whether the specified package was imported or whether there were problems with the import.

FpPkgImportResult can be one of the following FpPkgImportResult constants.

fpPkgImportCancelledImport was cancelled by the user.
fpPkgImportCompleteImport was completed successfully.
fpPkgImportErrorInPackage Import was cancelled because an error in the package was found (for example, an invalid manifest or damaged files).
fpPkgImportFailedImport failed for an unknown reason.
fpPkgImportNotTrustedImport was cancelled because the package was not signed by a trusted certificate or the FpPkgTrustLevel parameter was not set to fpPkgTrustAll.
fpPkgImportServerNotSupportedImport was cancelled because the server on which the Web site is located does not support Web packages.
fpPkgImportStoppedImport was cancelled because a file, folder, or list conflict caused the import process to stop as a result of the value of the fpConflictOpts parameter

expression.ImportWebPackage(packageFileName, urlDeployTo, FpPkgTrustLevel, fpConflictOpts)

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

packageFileName    Required String. The path and file name of the package to be imported.

urlDeployTo    Required String. The path to which to import the files included in the Web package.

FpPkgTrustLevel    Required FpPkgTrustLevel. Specifies whether to trust all Web packages or only those that are digitally signed by a trusted source.

FpPkgTrustLevel can be one of the following FpPkgTrustLevel constants.

fpPkgTrustAll
fpPkgTrustCertificateStore

fpConflictOpts    Required FpPkgImportConflictOpts. Specifies how to handle conflicts.

FpPkgImportConflictOpts can be one of the following FpPkgImportConflictOpts constants.

fpPkgFileConflictMask
fpPkgListConflictMask
fpPkgOnConflictSkipSkips importing any files if a conflict arises when importing a Web package, and continues the import process.
fpPkgOnConflictStopStops the import process if any conflict arises when importing a Web package, and continues the import process.
fpPkgOnFileConflictOverwriteIf a file conflict exists, overwrites that file.
fpPkgOnFileConflictSkipSkips importing a file in the Web package that conflicts with a file in the Web site, and continues the import process.
fpPkgOnFileConflictStopStops the import process if a file if the Web package conflicts with an existing file in the Web site.
fpPkgOnListConflictMergeOrRenameMerges lists if they are compatible; otherwise, the Web lists are backed up and imported, and the import process continues.
fpPkgOnListConflictMergeOrSkipMerges lists if compatible; otherwise, the import process skips the conflicting lists and continues.
fpPkgOnListConflictMergeOrStopMerges lists if compatible; otherwise, the import process stops.
fpPkgOnListConflictRenameBacks up all conflicting lists and continues the import process.
fpPkgOnListConflictSkipSkips deployment of a list if a list conflict exists.
fpPkgOnListConflictStopStops the import process of a Web package if a list conflict exists.

Remarks

You can import Web packages only into Web sites based on Microsoft Windows SharePoint Services.

Example

The following example imports the specified Web package into a new folder in the active Web site.

    Dim objWeb As WebEx
Dim objFolder As WebFolder

Set objWeb = ActiveWeb
Set objFolder = objWeb.AllFolders.Add("NewWebPackageFolder")

objWeb.ImportWebPackage "c:\NewWebPackage.fwp", objFolder.Url, _
    fpPkgTrustCertificateStore, fpPkgOnListConflictSkip