klingt einfach - aber ist wohl tricky - ich bekomme es nicht hin.
Hier ein Makro, das ich benutze um einen text so zu formatieren, dass er dann später als gültiger Dateiname taugt.
Was ich nicht hinbekomme, ist das Array so zu erweitern das ein " " " Apostrophe durch einen "_" ersetzt wird.
Habe alle Kombinationen von " und ' und "\" durchprobiert.
geht es einfach nicht ?
Oder weiß jemand einen Ausweg
Danke und Gruß
Luigi
Code: Alles auswählen
Sub fnKHM
oDoc = thisComponent
aFind = Array(" ", "ä" ,"\'", "\+" ,"ö" ,"ü", "-", "\.", "MS", "\(|\)", "ß", "_[0-9]_[0-9][0-9]min", "_+[0-9]+$", "_\&_", "_\?", "_$", "Nt", "\*|\:", "_{2,}")
aReplace = Array("_", "ae", "", "_und_", "oe", "ue", "_", "_", "_MS_", "", "ss", "", "", "_", "_", "", "NT", "_", "_") ' just for trying)
'aReplace = Array("១", "២", "៣", "៤", "៥", "៦", "៧", "៨", "៩", "០")
aRayCount = 0
oRange = oDoc.getCurrentSelection() ' modified by Zizi64
FandR = oRange.createReplaceDescriptor() ' modified by Zizi64
FandR.SearchCaseSensitive = true
FandR.SearchRegularExpression = true
While aRayCount <= uBound(aFind)
FandR.setSearchString(aFind(aRayCount))
FandR.setReplaceString(aReplace(aRayCount))
aRayCount = aRayCount + 1
oRange.ReplaceAll(FandR) ' modified by Zizi64
Wend
End Sub
lorbass, Moderator