Microsoft KB Archive/304070

= FP: Run-time Error '-2147467259 (80004005)' Publishing to Root Web/Subweb =

Article ID: 304070

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft FrontPage 2002 Standard Edition
 * Microsoft FrontPage 2000 Standard Edition

-



This article was previously published under Q304070



SYMPTOMS
When you attempt to publish a Microsoft FrontPage Web to a root Web by using a Microsoft Visual Basic for Applications macro, the following error message appears:

Run-time error '-2147467259 (80004005)':

Bad parameter passed to Web Server Extensions. Check the information you entered and try again.

If you attempt to publish to an existing subweb rather than a root Web, the following error message appears:

Run-time error '-2147467259 (80004005)':

Server error: Web already exists: &quot;/subweb_name&quot;.

Note the similarity of these two error messages.



CAUSE
This problem can occur if the destination Web already exists.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Because the Web already exists, you should use the fpPublishAddToExistingWeb publish flag when publishing to a Web.

NOTE: When you use Microsoft FrontPage 2002, Microsoft recommends you use the fpPublishNoDeleteUnmatched flag so that content that is in conflict will not be deleted.

The following sample Visual Basic code prompts for a source and destination Web and adds the appropriate publish flags when it publishes the source Web to the destination Web. Sub PublishWeb ' Set up variables. For FrontPage 2000 compatibility, dim the source ' and destination Webs as &quot;As Web&quot;. For FrontPage 2002 compatibility, ' dim these variables as &quot;As WebEx&quot;. Dim sSourceWebURL  As String Dim sDestWebURL    As String Dim oSourceWeb     As Web Dim oDestWeb       As Web ' Prevent any errors from crashing. On Error Resume Next ' Prompt for the source Web. sSourceWebURL = InputBox(&quot;Enter source URL:&quot; & vbCrLf & _     &quot;If this is a server-based Web, include 'http://' in the URL.&quot;, _        &quot;Publish Web&quot;) ' Prompt for the destination Web. sDestWebURL = InputBox(&quot;Enter destination URL:&quot; & _     &quot;If this is a server-based Web, include 'http://' in the URL.&quot;, _         &quot;Publish Web&quot;) ' Check to make sure you have both URLs. If sSourceWebURL = &quot;&quot; Or sDestWebURL = &quot;&quot; Then MsgBox &quot;You must enter a source and destination URL.&quot; _ & &quot;Please try again.&quot; Exit Sub End If   ' Open the source Web. Set oSourceWeb = Webs.Open(sSourceWebURL)

' See if the source Web exists. If oSourceWeb Is Nothing Then MsgBox &quot;The source Web could not be found.&quot; _ & &quot;Please try again.&quot; Exit Sub End If

' The Add method creates the Web if it doesn't exist. Therefore, ' by using this method, you will always publish with the ' fpPublishAddToExistingWeb flag. Set oDestWeb = Webs.Add(sDestWebURL) If oDestWeb Is Nothing Then MsgBox &quot;The destination Web could not be created.&quot; _ & &quot;Please try again.&quot; ActiveWebWindow.Close oSourceWeb.Close Exit Sub End If

' Close the ActiveWebWindow. The ActiveWebWindow contains the ' destination Web at this point, and since it's already done its job, ' you no longer need to keep it open. ActiveWebWindow.Close

'Publish the Web oSourceWeb.Publish sDestWebURL, fpPublishAddToExistingWeb End Sub

Additional query words: front page fp2000 fp2002

Keywords: kbnofix kbprb KB304070

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.