MOD2000: PublishCurrentWeb Code from Code Librarian Does Not Compile (259632)



The information in this article applies to:

  • Microsoft Office 2000 Developer

This article was previously published under Q259632

SYMPTOMS

When you copy the code example PublishCurrentWeb from the Code Librarian and paste it into the Visual Basic Editor, you notice that the fourth line of code appears in red. If you compile the code, you receive the following error message:
Compile Error:

Syntax Error

CAUSE

A parenthesis is missing at the end of the fourth line of code after "my password."

RESOLUTION

Add a closing parenthesis after "my password," as shown in the following example:
Sub PublishCurrentWeb()
 Dim sTargetURL As String
 sTargetURL = "http://localhost/mynewweb"
 Call ActiveWeb.Publish(sTargetURL, fpPublishAddToExistingWeb + _
 fpPublishIncremental, Application.UserName, "mypassword")
End Sub
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open Microsoft FrontPage.
  2. On the Tools menu, point to Macro, and then click Visual Basic Editor.
  3. On the Insert menu, click Module.
  4. On the Add-ins menu, click Code Librarian.
  5. If the CodeLib.mdb file is not already open, click Open on the File menu. Click CodeLib.mdb, and then click Open.
  6. In the Code Librarian, click the Contents tab, and then click FrontPage.
  7. In the Code column on the right, scroll down to the "PublishCurrentWeb" topic, and then double-click it.
  8. Select the entire code example, and then click Copy on the Edit menu.
  9. Close the Code Librarian.
  10. In the new module, click Paste on the Edit menu. Note that the fourth line of code appears in red.
  11. On the Debug menu, click Compile Microsoft_FrontPage. Note that you receive the error message described in the "Summary" section of this article.

Modification Type:MajorLast Reviewed:7/31/2001
Keywords:kbbug kbCodeLibrarian kbdocerr kberrmsg KB259632