This function deletes the selected registry key of the Rx medication.
object.DeleteRegistryKey
aRegistryKey
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISRxMedication interface |
|
aRegistryKey |
In, Required | The registry key to delete |
Delete the selected registry key of the Rx medication and display the number of registry keys before and after deleting.
sub main
Dim aMedicationId
Dim aRxMedication
Dim aRegistryKeys, aRegistryKey
Dim aRxMedicationInfo
aMedicationId = 1507
Set tr = Profile.StartMapTransaction
aRxMedicationInfo = GetRegistryKeysForMedicationInfo(aMedicationId, aRxMedication)
if aRxMedication is nothing then
Profile.MsgBox(aRxMedicationInfo)
exit sub
end if
aRxMedicationInfo = "Before deleting: " & aRxMedicationInfo
set aRegistryKeys = aRxMedication.GetRegistryKeys
if aRegistryKeys.Count > 0 then
set aRegistryKey = aRegistryKeys.Item(0)
aRxMedicationInfo = aRxMedicationInfo &_
"Try to delete registry key '" & aRegistryKey.KeyCode.Code &_
"' ( with value " & aRegistryKey.KeyValue & " )" & vbNewLine
aRxMedication.DeleteRegistryKey(aRegistryKey)
end if
tr.Commit
set tr = Profile.StartMapTransaction
aRxMedicationInfo = aRxMedicationInfo &_
"After deleting: " & GetRegistryKeysForMedicationInfo(aMedicationId, aRxMedication)
Profile.MsgBox(aRxMedicationInfo)
end sub
function GetRegistryKeysForMedicationInfo(aMedicationId, aRxMedication)
Dim aInfo
Dim aRegistryKeys
set aRxMedication = Profile.LoadRxMedication(aMedicationId)
if aRxMedication is nothing then
aInfo = "There is no Rx Medication with the specified ID" & vbNewLine
else
set aRegistryKeys = aRxMedication.GetRegistryKeys
aInfo = aRxMedication.RxName & " has " & aRegistryKeys.Count &_
" registry keys" & vbNewLine
end if
GetRegistryKeysForMedicationInfo = aInfo
end function
In Profile Client v8 on User Interface Registry Keys cannot be found, but Rx medications can be found in
.