Word 表格边框 |
尚未結案
|
Azote
一般會員 ![]() ![]() 發表:6 回覆:4 積分:2 註冊:2004-04-14 發送簡訊給我 |
|
qoo1234
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:256 回覆:1167 積分:659 註冊:2003-02-24 發送簡訊給我 |
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; WordApp:Variant; NewDoc:Variant; NewTable:Variant; Range:Variant; implementation uses comobj; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var i,j,s:Integer; begin WordApp :=CreateOleObject('word.application'); WordApp.visible :=True; NewDoc :=WordApp.Documents.add; Range :=WordApp.Selection.Range; NewTable :=NewDoc.tables.Add(range,9,9); for i:=1 to 9 do for j:=1 to 9 do begin s:=i*j; NewTable.cell(i,j).Range.Text:=IntToStr(i) '*' IntToStr(j) '=' IntToStr(s); end; end; //Word表格:設定表格框線(單一欄位) procedure TForm1.Button2Click(Sender: TObject); const wdBorderTop=-1; wdBorderLeft=-2; wdBorderBottom=-3; wdBorderRight=-4; wdLineStyleDouble=7; begin NewTable.Cell(1,1).Range.Borders.Item(wdBorderLeft).LineStyle := wdLineStyleDouble; NewTable.Cell(1,1).Range.Borders.Item(wdBorderRight).LineStyle := wdLineStyleDouble; NewTable.Cell(1,1).Range.Borders.Item(wdBorderTop).LineStyle := wdLineStyleDouble; NewTable.Cell(1,1).Range.Borders.Item(wdBorderBottom).LineStyle := wdLineStyleDouble; NewTable.Cell(1,1).Range.Borders.Shadow := False; end; end. ![]() |
Azote
一般會員 ![]() ![]() 發表:6 回覆:4 積分:2 註冊:2004-04-14 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |