Microsoft KB Archive/259632

= MOD2000: PublishCurrentWeb Code from Code Librarian Does Not Compile =

Article ID: 259632

Article Last Modified on 7/31/2001

-

APPLIES TO


 * Microsoft Office 2000 Developer Edition

-



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 &quot;my password.&quot;



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



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



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 &quot;PublishCurrentWeb&quot; 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 &quot;Summary&quot; section of this article.

Additional query words: pra

Keywords: kberrmsg kbbug kbnofix kbcodelibrarian kbdocerr KB259632

-

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

© Microsoft Corporation. All rights reserved.