Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


hallo,

so klappt es !


die stellen, die formatiert werden sollen beginnen mit einem '<' und
enden mit einem leerzeichen!

lg
jochen

code:

Option Explicit
public const VON as string = "<"
public const BIS as string = " "

Sub formatiereMyTextstellen
GlobalScope.BasicLibraries.LoadLibrary("Tools")
    dim oDoc as object 'xDocument
    dim osdStart as object 'xSearchDescriptor
    dim otrStart as object 'xTextRange
    dim osdEnd as object 'xSearchDescriptor
    dim otrEnd as object 'xTextRange
    dim i as integer
    dim otxt as String
       
    oDoc = thisComponent
   

    osdStart = oDoc.createSearchDescriptor()
    osdStart.setSearchString(VON)
    otrStart = oDoc.findFirst(osdStart)
    if IsNull(otrStart) then exit sub 'stop wenn kein ergebnis

    osdEnd = oDoc.createSearchDescriptor()   
    osdEnd.setSearchString(BIS)
    otrEnd = oDoc.findFirst(osdEnd)
    if IsNull(otrEnd) then exit sub 'stop, wenn kein

    otrStart.gotoRange(oDoc.findnext(otrStart.End, osdEnd).End,true)
    i = otrStart.Start.CharHeight
    otrStart.CharHeight = i + 4
    otrStart.CharWeight = com.sun.star.awt.FontWeight.BOLD
       otrStart.CharPosture= com.sun.star.awt.FontSlant.NONE
    otxt = otrStart.getString()
    otrStart.setString(DeleteStr(otxt,VON))
   
    do until isNull(otrStart)
        otrStart=oDoc.findNext(otrStart.End,osdStart)
        if IsNull(otrStart) then exit sub 'stop wenn kein ergebnis
        otrStart.gotoRange(oDoc.findnext(otrStart.End, osdEnd).End,true)
   
        otrStart.CharHeight = i + 4
        otrStart.CharWeight = com.sun.star.awt.FontWeight.BOLD
        otrStart.CharPosture= com.sun.star.awt.FontSlant.NONE
        otxt = otrStart.getString()
        otrStart.setString(DeleteStr(otxt,VON))
        'msgbox otrStart.getString()
    loop

End Sub

-- 
Liste abmelden mit E-Mail an: users+unsubscribe@de.libreoffice.org
Probleme? http://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: http://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: http://listarchives.libreoffice.org/de/users/
Alle E-Mails an diese Liste werden unlöschbar öffentlich archiviert

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.