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


Hallo Robert,

Am 18.12.2011 20:59, schrieb Robert Großkopf:
gehe einmal dem folgenden Link nach:
http://www.starbasicfaq.de/WiekannmaninCalc-Dokumentensuchenunderse.html#Zweig225

Ja. Das war ein wichtiger Hinweis. In Calc verhält sich die Suchfunktion anders als in Writer.

Der unten stehende Quellcode führt dazu, dass "Musterwort" gefunden wird und die Schrift in der Zelle ausgetauscht wird, die das Wort "Musterwort" enthält. Dies ist natürlich nicht das Ziel. Wenn ich die Schleife remme - also von "Do " bis "Loop" passiert nichts, d.h. es fehlt jetzt nur noch, dass die Zelle aktiviert wird.

Hat das jemand einen Tipp?

Gruß

Jochen


sub Suchen_Ersetzen()
 oSheet =ThisComponent.sheets(0)
 Dim vDescriptor
 Dim vFound
 vDescriptor = oSheet.createSearchDescriptor()
  REM Set the text for which to search and other
REM http://api.openoffice.org/docs/common/ref/com/sun/star/util/SearchDescriptor.html
  With vDescriptor
    .SearchString = "Musterwort"
    msgBox .SearchString
    .SearchWords = false
    .SearchCaseSensitive = false
    .SearchBackwards = false
  End With
  REM Find the first one, or last one as it were!
  vFound = oSheet.findFirst(vDescriptor)
  Do While Not IsNull(vFound)
    if not IsEmpty(vFound.CharFontName) then
      if vFound.CharFontName = "Times New Roman" then
        vFound.CharFontName = "Symbol"
        endif
      endif
    vFound = oSheet.findNext( vFound.getEnd(), vDescriptor)
  Loop
End Sub

--
Informationen zum Abmelden: E-Mail an users+help@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.