FP2000: How to Access Most Recently Used List Using VBA

ID: Q230579


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


SUMMARY

The FrontPage object model does not have any built-in functionality to access the Most Recently Used (MRU) list; however, the Office Commandbar object model allows access to the items on this menu from within FrontPage using Visual Basic for Applications (VBA).


MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals 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 needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp

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.

The following VBA code displays the contents of the MRU list in the Immediate Window in the Visual Basic Editor:

NOTE: To open the Immediate Window, click Immediate Window on the View menu.


Sub PrintMRU
   Dim MyBar As CommandBarControl ' declare MyBar as CommandBarControl
   Dim MyBar2 As CommandBarControl ' declare MyBar2 as CommandBarControl
   Set MyBar = CommandBars.ActiveMenuBar.Controls("File").Controls("Recent W&ebs") 'Sets MyBar as the MRU
   For Each MyBar2 In MyBar.Controls ' This For..Next Loop prints 
      Debug.Print MyBar2.Caption    ' Each Item (MyBar2) in the MRU (MyBar)
   Next MyBar2
End Sub 
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

Additional query words:

Keywords :
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbhowto


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