谢谢!
解决方案 »
- delphi2010中idftp文件列表后文件名乱码?
- Bluetooth_Framework_VCL
- FireBird数据库的dbExpress驱动程序是dbexpUIBfire15.dll?
- 求能解释 T-SQL 脚本的控件,不用连接 数据库的那种 控件
- AssignFile( MyFile, 'com1') 实现小票机串并口直接打印,怎样控制字体大小?
- 我是学c的,最近对delphi很感兴趣,请各位大侠帮忙推荐教程及学习方法.
- 怎样遍历一目录树并将其子目录及文件拷贝到另一地方
- 求助!谁能给个Delphi5下的ADO补丁下载地址?
- 求教高手
- 如何将font.style写入ini文件呢
- 各位江湖的老大们 你们是怎么使你们的应用程序适应不同的分辨率的呢?可否教教小弟
- ***************怎样才能提取SWF文件里的图片(JPG或BMP格式)?请大家给点建议*************
var
FileName, ConfirmConversions, ReadOnly, AddToRecentFiles,
PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument,
WritePasswordTemplate, Format: OleVariant;
ItemIndex :OleVariant;
i:integer;
mytable:table;
myrange:range;
rend:OleVariant;
begin
filename:='包含表格的word文档';
ConfirmConversions := False;
ReadOnly := False;
AddToRecentFiles := False;
PasswordDocument := '';
PasswordTemplate := '';
Revert := True;
WritePasswordDocument := '';
WritePasswordTemplate := '';
Format := wdOpenFormatDocument;
wordapplication1.Visible:=true;
try
WordApplication1.Documents.Open(FileName, ConfirmConversions, ReadOnly,
AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert,
WritePasswordDocument, WritePasswordTemplate, Format,emptyparam,emptyparam);
except begin
Application.MessageBox('请检查文档是否能用WORD打开!','aa',MB_iconasterisk);
abort;
end;
end;
ItemIndex := 1;
WordDocument1.ConnectTo(WordApplication1.Documents.Item(ItemIndex));
mytable:=WordDocument1.Tables.Item(1);
mytable.Select;
worddocument1.Range.InsertAfter(''+#13);
wordapplication1.Selection.Copy;
rend:=worddocument1.Range.End_-1;
myrange:=WordDocument1.Range(rend,rend);
myrange.Paste;
wordapplication1.Quit;
wordapplication1.Disconnect;
end;
http://community.csdn.net/Expert/topic/3442/3442850.xml?temp=.1020624