The information in this article applies to:
SUMMARYIn Microsoft Excel 5.0 for Windows, you can create a macro to find the default directory of any application that registers itself in the [EXTENSIONS] section of the WIN.INI file. Given the three-character extension for the application[ASCII 146]s file, the macro below uses the Microsoft Windows dynamic-link libraries (DLLs) to return the default directory information. MORE INFORMATION
Microsoft provides examples of Visual Basic for Applications procedures 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. The Visual Basic procedures in this article are
provided 'as is' and Microsoft does not guarantee that they can be used in
all situations. While Microsoft support professionals can help explain the
functionality of a particular macro, they will not modify these examples to
provide added functionality, nor will they help you construct macros to
meet your specific needs. If you have limited programming experience, you
may want to consult one of the Microsoft Solution Providers. Solution
Providers offer a wide range of fee-based services, including creating
custom macros. For more information about Microsoft Solution Providers,
call Microsoft Customer Information Service at (800) 426-9400.
Sample Macro Code
To run this macro, place the insertion point anywhere in the Sub
Application_Directory() line and either press F5 or choose Start from the
Run menu.
When you are prompted to enter a three-letter extension, enter an extension and choose OK. The macro will use the Microsoft Windows API to determine which directory contains the application that uses that three-letter extension. For example, if you enter xls, the message box will tell you where the Microsoft Excel application is installed. For information about creating a similar Visual Basic macro to find the default printer and port assignments, query on the following words in the Microsoft Knowledge Base: device and port and visual and basic and printer REFERENCESMicrosoft Windows SDK Microsoft Visual Basic 3.0 Professional - WINAPI31.HLP help file Additional query words: 5.0 call register
Keywords : kbprg |
Last Reviewed: October 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |