vtiPublishWeb

C++: long vtiPublishWeb(LPCTSTR pszServerUrl, LPCTSTR pszWebName, long dwFlags, LPCTSTR pszUser, LPCTSTR pszPassword)
VB: vtiPublishWeb(ServerURL as String, WebName as String, Flags as Long, User as String, Password as String) as Long

Description

This method provides an interface to the FrontPage Explorer’s File : Publish FrontPage Web command. It copies the web that is currently open in the Explorer to the target server and web name. This is a useful method for automating the transfer of web content from a staging server to a deployment server.

Return Value

0 for failure

1 for success

Parameters

ServerUrl specifies the web you are publishing to. It can include a file:// or http:// or https:// prefix. If no prefix is provided, http:// is assumed. If a file path like C:\ is provided, the file:// prefix is assumed. Examples: “http://www.microsoft.com”, “http://microsoft:8080”.

WebName is either empty (“ ”) for the Root Web or it is a subweb name without a slash (e.g. “MySubWeb”.)

User is the user name to use when creating the target web (if necessary). If User is NULL, then the User name and password already established for the open web in the Explorer are used for the publishing operation.

Password is the password corresponding to the User account to use when creating the target web.

Flags is a bit field that allows the setting of various options (which correspond to checkboxes in the File, Publish FrontPage Web dialog box). You can logically OR these values together and pass the result to set the following options:

value meaning
1 Perform an incremental copy (only pages that have changed are copied)
2 Add to an existing web (don’t create a new one)
4 Copy all subwebs (only valid for Root Web)

NOTE for Visual Basic Users: The vtiPublishWeb call can take a long time. To avoid user confusion from the default Server Busy dialog in VB, you should wrap your calls to this method from VB with the following code:

   App.OleRequestPendingTimeout = 1000
   App.OleRequestPendingMsgTxt = “PublishWeb in progress. Please be patient.”
   ; Your call to vtiPublishWeb goes here
   App.OleRequestPendingTimeout = 5000
   App.OleRequestPendingMsgTxt = “ ”

WARNING:  As with any program that contains password information, creating a program that uses vtiPublishWeb( ) and specifies a Password string creates a potential security hole unless you can protect against physical access to the executable. This is because the executable can be searched for the user account name and password string parameter used in to the call to vtiPublishWeb. Therefore, we recommend that you use this function with caution.