![]() |
Word -Dokument den Cursor positionieren
Hallo liebes Forum,
ich füge den Inhalt eines Stringgrid's in Word ein:
Delphi-Quellcode:
Meine Frage wäre, wie kann ich den Cursor ans Ende unter die Tabelle setzen?
//1. spalte zentriert
WordApp.Selection.movedown(wdline, lineszaehler, wdextend); WordApp.Selection.ParagraphFormat.Alignment := wdAlignParagraphCenter; //nächste Spalte WordApp.Selection.moveright(wdcharacter, 1); if wordversion = '12.0' then WordTable.Style := 'Tabellengitternetz'; begin ProgressBar1.Max := iRows; for iGridRows := 1 to iRows do begin ProgressBar1.Position := 6 + iGridRows; for jGridCols := 1 to iCols do begin WordTable.Cell(iGridRows, jGridCols).Range.Text := StringGrid2.Cells[jGridCols - 1, igridRows - 1]; end; end; end; end else ProgressBar1.Position := 0; Freundliche Grüße Aaron |
Re: Word -Dokument den Cursor positionieren
Hab's doch rausgefunden:
Delphi-Quellcode:
Viele Grüße
WordApp.Selection.EndKey(wdStory);
aaron |
Re: Word -Dokument den Cursor positionieren
Ich muss das Thema nochmal hochholen.
Ich füge eine Tabelle hinzu
Delphi-Quellcode:
Nun möchte ich unterhalb dieser Tabelle (eine Zeile Abstand) noch eine Tabelle einfügen.
// Tabelle hinzufügen
curTable := WordDocument.Tables.Add(WordApplication.Selection.Range, 5, 3, defaultTableBehavior, autoFitBehavior); Ich habe nun folgendes Versucht
Delphi-Quellcode:
moveUnit, moveCount, ext:olevariant;
moveUnit := wdStory; moveCount := 1; WordApplication.Selection.EndKey(moveUnit, moveCount); Er springt zwar ans Ende der Tabelle, nur ist diese nun komplett markiert. Wie kann ich es bewerkstelligen, dass ich beide Tabellen mit einer Leerzeile dazwischen anzeige? |
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:19 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