But I need to limit the find and replace to the current selection. Can anyone tell me how to do that?
Thanks!
Code: Select all
Sub KhmerNumbers
oDoc = thisComponent
aFind = Array("1", "2","3" ,"4", "5" ,"6" ,"7", "8", "9", "0")
aReplace = Array("១", "២", "៣", "៤", "៥", "៦", "៧", "៨", "៩", "០")
aRayCount = 0
FandR = oDoc.createReplaceDescriptor
FandR.SearchCaseSensitive = true
FandR.SearchRegularExpression = true
While aRayCount <= uBound(aFind)
FandR.setSearchString(aFind(aRayCount))
FandR.setReplaceString(aReplace(aRayCount))
aRayCount = aRayCount + 1
oDoc.ReplaceAll(FandR)
Wend
End Sub