Find and Replace Macro for Current Selection Only with Match Case

I have created following macro. There are several search terms in the macro I have included just one for example. I wish that the macro should find a value only in the selected text. Similarly I wish that it should match case while finding the value. What changes I should do in the macro.

REM  *****  BASIC  *****

Sub KrutiDevToUnicode
  Dim oDescriptor  'The search descriptor
  Dim oFound       'The found range
  Dim oFoundAll    'The found range
  Dim n%           'General index variable
  oDescriptor = ThisComponent.createSearchDescriptor()
  
oDescriptor.SearchString = "yZ"
  oFoundAll = ThisComponent.findAll(oDescriptor)
  For n% = 0 to oFoundAll.getCount()-1
    oFound = oFoundAll.getByIndex(n%)
    oFound.setString("र्ल")
  Next
End Sub

[Edit - Opaque] Formatted code as preformatted text