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.
fpPkgImportCancelled | Import was cancelled by the user. |
fpPkgImportComplete | Import was completed successfully. |
fpPkgImportErrorInPackage | Import was cancelled because an error in the package was found (for example, an invalid manifest or damaged files). |
fpPkgImportFailed | Import failed for an unknown reason. |
fpPkgImportNotTrusted | Import was cancelled because the package was not signed by a trusted certificate or the FpPkgTrustLevel parameter was not set to fpPkgTrustAll. |
fpPkgImportServerNotSupported | Import was cancelled because the server on which the Web site is located does not support Web packages. |
fpPkgImportStopped | Import 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 | |
fpPkgOnConflictSkip | Skips importing any files if a conflict arises when importing a Web package, and continues the import process. |
fpPkgOnConflictStop | Stops the import process if any conflict arises when importing a Web package, and continues the import process. |
fpPkgOnFileConflictOverwrite | If a file conflict exists, overwrites that file. |
fpPkgOnFileConflictSkip | Skips importing a file in the Web package that conflicts with a file in the Web site, and continues the import process. |
fpPkgOnFileConflictStop | Stops the import process if a file if the Web package conflicts with an existing file in the Web site. |
fpPkgOnListConflictMergeOrRename | Merges lists if they are compatible; otherwise, the Web lists are backed up and imported, and the import process continues. |
fpPkgOnListConflictMergeOrSkip | Merges lists if compatible; otherwise, the import process skips the conflicting lists and continues. |
fpPkgOnListConflictMergeOrStop | Merges lists if compatible; otherwise, the import process stops. |
fpPkgOnListConflictRename | Backs up all conflicting lists and continues the import process. |
fpPkgOnListConflictSkip | Skips deployment of a list if a list conflict exists. |
fpPkgOnListConflictStop | Stops 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