![]() |
Excel Object-Text lesen
Ich versuche, bei Objekten in einer Excel 2003 Tabelle die Texte auszulesen, und zwar für AutoShapes, Textboxen und Wordart.
Bei den Textboxen klapp das problemlos mit:
Delphi-Quellcode:
In den anderen beiden Fällen Fälle bekomme ich die Exception EVariantInvalidOpError.
AShape.TextFrame.Characters.Text
Hat jemand einen Tipp?
Delphi-Quellcode:
var AShape: Variant; AType: Integer; for I := 1 to Excel.ActiveSheet.Shapes.Count do begin AShape := Excel.ActiveSheet.Shapes[I]; AType := AShape.Type; case AType of 1: if AShape.TextFrame.Characters.Text <> '' then begin // msoAutoShape Inc(NumShapes); Inc(NumAutoShapes); end; 15: if AShape.TextFrame.Characters.Text <> '' then begin // msoTextEffect Inc(NumShapes); Inc(NumTextEffects); end; 17: if AShape.TextFrame.Characters.Text <> '' then begin // msoTextBox Inc(NumShapes); Inc(NumTextBoxes); end; end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:02 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz