如题
解决方案 »
- 能否认为数组和动态数组的地址是连续的?
- fast report3如何安装
- 心情不爽,散分
- 在DELPHI中如何动态创建一个LABEL控件?
- Mastering Delphi 7介绍、目录和源码下载
- EnumChildWindows 不是枚举所有的子窗口吗?为何我只能得到最后一个?
- 大家用delphi开发过语音技术么?
- 版主请关注,非常怀疑icqvsvol和cg1120(代码最优化-§雪是冷的,人是暖的§) 是同一个人,我鄙视象cg1120(代码最优化-§雪是冷的,人是
- SQL查询为什么会是这样的结果?
- 用ReadLn读文本文件,文件较大(960K)的竟然读不出!把文件名改为另一个较小的文本文件,其它代码不变,运行正常,这证明程序无误。我不
- CoIntialize(nil);CoUnitialize;该引用什么啊
- 如何从ACCESS转换到SQL SERVER
或者Borders[Idx](Border)的Color
Word2000;procedure TWMITaskManagerMainForm.ButtonWordClick(Sender: TObject);
var
WordApplication: TWordApplication;
WordDocument: TWordDocument;
DocInx, oFileName, CfCversions, oReadOnly, AddToRctFiles, PswDocument,
PswTemplate, oRevert, WPswDocument, WPswTemplate, oFormat, oEncoding, oVisible: OleVariant;
Idx: Integer;
Row: Integer;
Col: Integer;
_Cell: Cell;
begin
WordApplication := TWordApplication.Create(nil);
WordApplication.Visible := True;
WordDocument := TWordDocument.Create(nil); DocInx := 1;
oFileName := 'c:\test.doc';
oReadOnly := True;
CfCversions := EmptyParam;
AddToRctFiles := EmptyParam;
PswDocument := EmptyParam;
PswTemplate := EmptyParam;
oRevert := EmptyParam;
WPswDocument := EmptyParam;
WPswTemplate := EmptyParam;
oFormat := EmptyParam;
oEncoding := EmptyParam;
oVisible := True; WordApplication.Documents.Open(oFileName, CfCversions, oReadOnly, AddToRctFiles,
PswDocument, PswTemplate, oRevert, WPswDocument,
WPswTemplate, oFormat, oEncoding, oVisible); WordDocument.ConnectTo(WordApplication.Documents.Item(DocInx)); Idx := 1; //按列变换表格线不同颜色
{for Col := 1 to WordDocument.Tables.Item(Idx).Columns.Count do
begin
WordDocument.Tables.Item(Idx).Columns.Item(Col).Borders.OutsideColorIndex := Col;
end; } //按行变换表格线不同颜色
{for Row := 1 to WordDocument.Tables.Item(Idx).Rows.Count do
begin
WordDocument.Tables.Item(Idx).Rows.Item(Row).Borders.OutsideColorIndex := Row;
end } //下面是综合颜色变换 (按单元格)字体颜色、表格线颜色
{for Idx := 1 to WordDocument.Tables.Count do
begin
for Row := 1 to WordDocument.Tables.Item(Idx).Rows.Count do
begin
for Col := 1 to WordDocument.Tables.Item(Idx).Columns.Count do
begin
_Cell := WordDocument.Tables.Item(Idx).Cell(Row, col);
_Cell.Borders.OutsideColor := clBlue;
_Cell.Range.Font.Color := clRed;
end
end;
end;}
end;
你对WORD好有研究,我这边还有个这方面的问题,不知道你能不能帮忙解决一下
就是如果改变WORD文档里的字体颜色,每个字体颜色都取反的,就是黑的变白的这样?
字体反色:_Cell.Range.Font.Color := RGB(255 -GetRValue(_Cell.Range.Font.Color),
255 -GetGValue(_Cell.Range.Font.Color),
255 -GetBValue(_Cell.Range.Font.Color));
_Color: TColor;...... _Color := WordDocument.Tables.Item(Idx).Range.Font.Color; WordDocument.Tables.Item(Idx).Range.Font.Color := RGB(255 -GetRValue(_Color),
255 -GetGValue(_Color),
255 -GetBValue(_Color));......其实修改单元格每个字体颜色应该更精细, 可以多种色彩。