ISExternalProvider.AddRegistryKey

Description

This function adds a new registry key to the external provider.

Syntax

object.AddRegistryKey(aKeyCode, aKeyValue)

Part Attribute Type Description
object Required
The object always implements the ISExternalProvider interface
aKeyCode In, Required
string
The code of the registry key
aKeyValue In, Required
string
The value of the registry key

Return Value

ISRegistryKey

Returns the added registry key.

Example

Add a new registry key to the external provider and display its ID and value.

Dim aExtProvider 
Dim aCode
Dim aRegKeyShortCode
Dim aRegKey
Dim aAllRegKeys
Dim aMessage

aRegKeyShortCode = "MSP M01"

aCode = "1"

Set aExtProvider = Profile.LoadExternalProvider(aCode)

if aExtProvider.ID = 0  then 
  Profile.MsgBox("No external provider with the specified code")
  exit sub   
end if

set aAllRegKeys = aExtProvider.GetRegistryKeys   
aMessage = aMessage & vbNewLine & "   Registry Keys Count = " & aAllRegKeys.Count 
  
set aRegKey = aExtProvider.AddRegistryKey(aRegKeyShortCode, "NiceValue") 
aExtProvider.Save
  
if aRegKey is nothing then
  aMessage = aMessage & vbNewLine & "No Registry Key was created"
else
  aMessage = aMessage & vbNewLine & "New Registry Key was created successfully " &_
    "( Id= " & aRegKey.Id & ", KeyValue = " & aRegKey.KeyValue & " )"
end if 
     
Profile.MsgBox (aMessage)   
Note:

In Profile Client v8 on User Interface Registry Key can be found and added in Organisation > External Providers > Basic > Registry.

Version information

Added in v7.8.0