Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Erste und letzte Zeile in Tabelle in Worddokument - Bold (https://www.delphipraxis.net/129476-erste-und-letzte-zeile-tabelle-worddokument-bold.html)

capo 19. Feb 2009 19:00


Erste und letzte Zeile in Tabelle in Worddokument - Bold
 
Hallo und guten Abend,

ich bin auf der Suche nach einer Möglichkeit die erste und die letzte Zeile einer Tabelle in Word "fett" zu formatieren.
Damit erzeuge ich meine Tabelle:
Delphi-Quellcode:
    WordTable := NewDoc.Tables.Add(WordApp.Selection.Range, iRows, iCols);
    ProgressBar1.Position := 4;
    WordTable.Columns.Item(1).SetWidth(65, 0);
    WordTable.Columns.Item(2).SetWidth(250, 0);
    WordTable.Columns.Item(3).SetWidth(120, 0);
    WordTable.Columns.Item(4).SetWidth(60, 0);

    WordTable.Borders.OutsideLineStyle := wdLineStyleSingle;
    WordTable.Borders.InsideLineStyle := wdLineStyleSingle;

    WordApp.activedocument.Tables.item(1).Columns.item(4).Select;
    WordApp.Selection.ParagraphFormat.Alignment := wdAlignParagraphRight;
      for iGridRows := 1 to iRows do
       begin
        ProgressBar1.Position := 6 + iGridRows;
        for jGridCols := 1 to iCols do
          begin
          WordTable.Cell(iGridRows, jGridCols).Range.Text := StringGrid1.Cells[jGridCols - 1, igridRows - 1];
Gruss Capo

capo 19. Feb 2009 19:18

Re: Erste und letzte Zeile in Tabelle in Worddokument - Bold
 
Die erste Zeile habe ich jetzt, die letzte dürfte schwieriger sein.
Delphi-Quellcode:
WordApp.activedocument.Tables.Item(1).Rows.Item(1).Range.Bold := True;

capo 20. Feb 2009 00:11

Re: Erste und letzte Zeile in Tabelle in Worddokument - Bold
 
hat sich erledigt...

fkerber 20. Feb 2009 05:39

Re: Erste und letzte Zeile in Tabelle in Worddokument - Bold
 
Hi!

Könntest du uns dann trotzdem sagen, wie es geht?
Falls dann jemand mal vor dem selben Problem steht, ist er sicher dankbar dafür!

Danke!

Ciao, Frederic

capo 20. Feb 2009 20:37

Re: Erste und letzte Zeile in Tabelle in Worddokument - Bold
 
Gerne:

Delphi-Quellcode:
var
  lineszaehler: integer;
begin
  lineszaehler := (StringGrid1.RowCount);

    // erste Zeile Bold
  WordApp.activedocument.Tables.Item(1).Rows.Item(1).Range.Bold := True;
      // letzte Zeile Bold
  WordApp.activedocument.Tables.Item(1).Rows.Item(lineszaehler).Range.Bold := True;
Gruss
Capo


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:37 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