Object Model Reference : Classes : C : CorelScriptTools : Methods : CorelScriptTools.RegistryQuery |
Function RegistryQuery(MainKey As Long, SubKey As String, Value As String) As Variant
Member of CorelScriptTools
The RegistryQuery method returns the value data of a specified value key in the computers Windows registry. This function can help you determine where programs and files are installed on a users computer. This type of information is important when creating scripts that are to run on different system setups.
The return value specifies the variable that is passed the value data of a specified value key in the Windows registry. Since this function can pass a string or numeric value, the variable you specify should be a variant. You can use the CorelScriptTools.GetType function to determine a variants subtype.
• |
You cannot use this command to query binary values except those that can be
converted to a number.
|
The following VBA example returns the root folder where Corel VENTURA 7 is installed.
Config_Ventura = REGISTRYQUERY (2, "SOFTWARE\Corel\Corel Ventura\7.0", "ConfigDir") |
The following VBA example returns the Arial True Type fonts file name.
Arial_file = REGISTRYQUERY (2, "SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts", "Arial (TrueType)") |
The following VBA example returns the name of the registered owner of Corel software:
YourName$ = REGISTRYQUERY(2,"SOFTWARE\Corel","UserName") |
The following VBA example returns the organization name of the registered owner of Corel software:
CompanyName$ = REGISTRYQUERY(2,"SOFTWARE\Corel","ORGANIZATION") |
The following VBA example returns the phone number of the registered owner of Corel software:
Phone$ = REGISTRYQUERY(2,"SOFTWARE\Corel","PHONENUMBER") |
Copyright 2013 Corel Corporation. All rights reserved.