API Documentation > CorelDRAW > 2025-v26 > CorelScriptTools > ICorelScriptTools
CorelScriptTools.RegistryQuery method
Registry Query
Syntax:
Function RegistryQuery(ByVal MainKey As Long, ByVal SubKey As String, ByVal Value As String) As Variant
Parameters:
Name Type Description
MainKey
Long
SubKey
String
Value
String
Remarks:
The RegistryQuery method returns the value data of a specified value key in the computer's Windows registry. This function can help you determine where programs and files are installed on a user's computer. This type of information is important when creating scripts that are to run on different system setups. You cannot use this command to query binary values except those that can be converted to a number.
Examples:
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 font's 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")