如何在delphi中向word插入表格及数据?
现在需要向word文档中,插入多张已有固定格式的表格,并在表格中输入数据?
现在需要向word文档中,插入多张已有固定格式的表格,并在表格中输入数据?
解决方案 »
- delphi 调用webservice 出现Unauthorized (401)错误
- 如何远程连接ACCESS数据库 千倍分(求助)
- 如何模拟按下组合键 alt+down 和 alt + a
- 高分求教,不够在给!
- 我想监控我的网卡出入互联网的页面,记录下浏览的网页地址和时间,能说说原理吗
- 利用adoquery如何关联fastreport的主从问题
- 高分提问,
- 关于多维动态数组定义的问题
- 运行出错
- 请问大虾们,这是怎么回事?好奇怪呀。有关socket!
- Delphi TClientDataSet 用Data提取数据后(没有与数据库相连接,没有和其他控件关联) ,多次调用TClientDataSet 的方法(如:First , Locate , Edit 等)都会报错,请高手指点
- StaticText 控件显示传递的全局变量
...
try
FWordApp := GetActiveOleObject('Word.Application');
except
try
FWordApp := CreateOleObject('Word.Application');
except
//没装Word
Exit;
end;
end;
FWordDoc := FWordDoc := FWordApp.Documents.Add;
...
//插入表格
FTable := FWordDoc.Tables.Add(FWordDoc.Range, 1, 1);
FTable .Cell(1, 1).Range.Text := '表格内容';
...
可看Delphi安装目录下Ocx\Servers下的Word相关单元及Word中的VBA部分
FTable.Borders.InsideLineStyle := wdLineStyleSingle;
FTable.Borders.OutsideLineStyle := wdLineStyleSingle;
FTable.Borders.InsideColorIndex := wdBlack;
FTable.Borders.OutsideColorIndex := wdBlack;去Ocx\Servers看那些文件,或者用TWordApplication\TWordDocument等试