如何在delphi dbgrid中的数据用表格形式转换成word excel 和html?
启动word excel的代码是什么?有没有参考资料,谢谢
启动word excel的代码是什么?有没有参考资料,谢谢
解决方案 »
- delphi 2006 与 delphi 7 乱码的问题
- delphi6 操作oracle10g的clob类型
- 为什么现在文章无法收藏?
- QuickReport如何保存为pdf文件??
- 如何得到指定窗口中状态条第一个PANEL的TEXT?
- 请问edit1.setfocus语句什么意思
- 如何在按下键盘上某个键后当前窗体自动隐藏,再次按下时则弹出窗体到最前面?
- 我想做一段小程序,在程序运行时,当键盘输入为'open'时把某变量设为真值,从而打开一些附加功能,应该怎样做?
- 加急电报:领导非要我用ADO+Oracle存储过程,Delphi中不能在client使用 Oracle的存储过程返回值?如之奈何?
- 新年送分_08 限新手
- 关于ado的问题
- ini文件?
begin
try
msword:=createoleobject('word.basic');
except
showmessage('不能启动microsoft word,退出');
exit;
end;
var
WordApp,WordDoc,WordTable:OleVariant;
i,j:integer;
begin
WordApp:=CreateOleObject('Word.Application');
WordApp.Visible:=True;
WordDoc:=WordApp.Documents.Add;
WordTable:=WordDoc.Tables.Add(WordApp.Selection.Range,DBGrid1.DataSource.DataSet.RecordCount+1,DBGrid1.Columns.Count);
for i:=1 to DBGrid1.Columns.Count do
WordTable.Cell(1,i).Range.InsertAfter(DBGrid1.Columns[i-1].Title.Caption);
i:=2;
with DBGrid1.DataSource.DataSet do
while not eof do
begin
for j:=1 to DBGrid1.Columns.Count do
WordTable.Cell(i,j).Range.InsertAfter(DBGrid1.Columns[j-1].Field.Value);
Next;
Inc(i);
end;
end;