FP2000: Cannot Open a Page in Page View with LocatePage Method

ID: Q229548


The information in this article applies to:
  • Microsoft FrontPage 2000


SYMPTOMS

When you use the Visual Basic for Applications (VBA) LocatePage method to open a page in page view while the web is not open, the following error message appears:

Runtime error '-2147467259 (80004005)':

The specified file or Web does not exist.


CAUSE

You cannot open a web document that is in a FrontPage web without first opening the web.


RESOLUTION

To programmatically open a page in page view without manually opening the web, you must also programmatically open the web. The following Visual Basic for Applications macro sample opens a disk-based web called "DBWeb" (located on the C: drive) and then opens a page named "MyHTMLPage.htm."


Sub OpenPage()

Dim myWeb As Web 'Declares myWeb as a Web object
Dim myFile As WebFile 'Declares myFile as a file

Set myWeb = Webs.Open("C:\DBWeb") ' Opens the Web
' Defines myFile as the MyHTMLPage.htm located in the Root Folder of 
' the Active Web
Set myFile = ActiveWeb.RootFolder.Files("MyHTMLPage.htm") 
myFile.Open ' Opens the page

End Sub 

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

For more information about using the sample code in this article, click the article number below to view the article in the Microsoft Knowledge Base:
Q212536 OFF2000: How to Run Sample Code from Knowledge Base Articles


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

For more information about "the LocatePage method", click Microsoft Visual Basic Help on the Help menu in the Visual Basic Editor, type "LocatePage" in the Answer Wizard, and then click Search to view the available topics.

Additional query words: front page

Keywords : kbdta
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: November 3, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.