Skip to content

Instantly share code, notes, and snippets.

@shantanuo
Created February 7, 2022 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shantanuo/70542d5c2a308f1cb0a9db91d6fabda4 to your computer and use it in GitHub Desktop.
Save shantanuo/70542d5c2a308f1cb0a9db91d6fabda4 to your computer and use it in GitHub Desktop.
उभी जोडाक्षरे आडवी करण्यासाठी लिब्रे ऑफिसच्या रायटरमधील मॅक्रो
REM ***** BASIC *****
Sub GaMa_jodakshar
Dim oDoc As Variant
Dim oSearchDescriptor As Variant
Dim oDictionary As Variant
Dim oReplace As Variant
Dim oStatusIndicator As Variant
Dim i As Long, j As Long
oDoc = ThisComponent
oStatusIndicator = oDoc.getCurrentController().getStatusIndicator()
oDictionary = Array( _
Array("क्‍", "क्"), _
Array("ख्‍", "ख्"), _
Array("ग्‍", "ग्"), _
Array("घ्‍", "घ्"), _
Array("च्‍", "च्"), _
Array("छ्‍", "छ्"), _
Array("ज्‍", "ज्"), _
Array("झ्‍", "झ्"), _
Array("ट्‍", "ट्"), _
Array("ठ्‍", "ठ्"), _
Array("ड्‍", "ड्"), _
Array("ढ्‍", "ढ्"), _
Array("ण्‍", "ण्"), _
Array("त्‍", "त्"), _
Array("थ्‍", "थ्"), _
Array("द्‍", "द्"), _
Array("ध्‍", "ध्"), _
Array("न्‍", "न्"), _
Array("प्‍", "प्"), _
Array("फ्‍", "फ्"), _
Array("ब्‍", "ब्"), _
Array("भ्‍", "भ्"), _
Array("म्‍", "म्"), _
Array("य्‍", "य्"), _
Array("र्‍", "ऱ्"), _
Array("ल्‍", "ल्"), _
Array("व्‍", "व्"), _
Array("श्‍", "श्"), _
Array("स्‍", "स्"), _
Array("ह्‍", "ह्"), _
Array("ळ्‍", "ळ्") )
oSearchDescriptor = oDoc.createSearchDescriptor()
oSearchDescriptor.SearchRegularExpression = True
oStatusIndicator.start("", UBound(oDictionary)+1)
For i = LBound(oDictionary) To UBound(oDictionary)
oReplace = oDictionary(i)
oSearchDescriptor.setReplaceString(oReplace(0))
oStatusIndicator.setText(oDictionary(i)(0))
oStatusIndicator.setValue(i+1)
For j = 1 To UBound(oReplace)
oSearchDescriptor.setSearchString(oReplace(j))
oDoc.replaceAll(oSearchDescriptor)
Next j
Next i
oStatusIndicator.end()
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment