如何使用WORD中之表格? |
尚未結案
|
clmao
一般會員 ![]() ![]() 發表:3 回覆:4 積分:1 註冊:2002-11-15 發送簡訊給我 |
|
cmf
尊榮會員 ![]() ![]() ![]() ![]() ![]() 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
引言: 想要將資料欄位寫入WORD表格。 請問站長: 1.如何建立表格? 2.如何將資料寫入之指定格子內?(第幾行,第幾格) 3.如何使用WORD的文字家底線? 謝謝您!unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Excel2000, OleServer, Word2000; type TForm1 = class(TForm) WordApplication1: TWordApplication; WordDocument1: TWordDocument; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); var NRows:integer; NCols:integer; t:Table; c:Cell; begin WordApplication1.Connect; WordDocument1.Connect; //1.如何建立表格? NRows:=5; NCols:=5; T:=WordDocument1.Tables.Add(WordDocument1.Range,NRows,NCols,wdWord9TableBehavior,wdAutoFitFixed); //2.如何將資料寫入之指定格子內?(第幾行,第幾格) c:=t.Cell(1,1); c.Select; WordApplication1.Selection.TypeText('aaaa'); // 3.如何使用WORD的文字家底線? WordApplication1.Selection.Font.Underline:=wdUnderlineSingle; WordApplication1.Visible:=TRUE; end; end.
------
︿︿ |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |