Word OLE Text ersetzen in Textelement
Hallo #,
mit Hilfe folgendes Codes kann ich per OLE in Word Text ersetzen. http://www.delphidabbler.com/tips/136 Ist der Text allerdings in einem Textelement, wird er nicht ersetzt ... Was kann ich da tun ? Hier steht was von StoryRanges, was ist das denn nun wieder ? *Kopf schüttel* http://word.mvps.org/faqs/customizat...ceAnywhere.htm Ich habs !!! Mit Hilfe dieser Seite http://www.swissdelphicenter.ch/de/showcode.php?id=2341 kommt dann folgendes raus
Delphi-Quellcode:
for iShape := 1 to WordApp.ActiveDocument.Shapes.Count do
begin sShapeText := WordApp.ActiveDocument.Shapes.Item(iShape).TextFrame.TextRange; sShapeText2 := StringReplace(sShapeText, SearchString, ReplaceString, [rfReplaceAll,rfIgnoreCase]); if sShapeText<>sShapeText2 then begin WordApp.ActiveDocument.Shapes.Item(iShape).TextFrame.TextRange := sShapeText2; end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:28 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz