在D7中,如何将数据库中的数据输出到word中,将要求试卷的格式.其中还包括图片.谢谢.
解决方案 »
- 轉換成字串輸入'0'
- 求Tchart 显示柱状图 实例代码?
- 调用Excel后无法释放
- 关于 GemPC TWin USB or Serial Smart card reader 的库函数
- 请问系统是不是可以对程序内存优化呢?,我的操作是,程序运行时用了系统20多m,我把最小化程序,在把程序最大化,程序内存就可有7到10m,小弟想
- delphi 打包程序时;那些文件应该被打包。dcu?ddp? 急!!
- delphi 表头与表身
- sql问题
- 大家帮我看看这条sql 语句,谢谢!
- 求助:哪里有reportbuilder的正版控件?
- 字段长度与错误类EoleException
- 如果大家都认为应用开发平台做不了复杂的业务逻辑的话,那这样的平台呢?
procedure TFxueji.bsSkinSpeedButton6Click(Sender: TObject);
var
WdUnit, WdCount, wdExtend: OleVariant;
num:integer;
T:table;
PageNum,i,count:integer;
filename:string;
itemindex,tempplate,newtemplate,documenttype,visible:olevariant;
begin
PageNum:=1;
count:=1;
WdUnit := 1;
wdCount := 1;
wdExtend := EmptyParam;
self.bsSkinOpenDialog1.Filter:='doc files|*.doc';
if self.bsskinOpenDialog1.Execute then
begin
visible:=true;
documenttype:=0;
FileName := bsskinOpendialog1.FileName;
itemindex:=1;
tempPlate:=Filename;
newtemplate:=false;
WordApplication1.Connect;
WordApplication1.Visible:=true;
WordApplication1.Documents.Add(TempPlate,newtemplate,documenttype,visible);
WordDocument1.ConnectTo(WordApplication1.Documents.Item(itemindex));
WordApplication1.Selection.WholeStory;
wordapplication1.Selection.Copy;
wordapplication1.Selection.MoveLeft(WdUnit, wdCount, wdExtend);
AddPageNum(wordapplication1,1);
fdm.TAddstudent.First;
for i:=0 to fdm.TAddstudent.RecordCount-1 do
begin
T:=self.WordDocument1.Tables.Item(pagenum);
t.cell(count+1,1).range.text:=fdm.TAddstudent.fieldbyname('jlh').AsString;
t.Cell(count+1,2).range.text:=fdm.TAddstudent.fieldbyname('xjh').AsString;
t.Cell(count+1,3).range.text:=fdm.TAddstudent.fieldbyname('xm').AsString;
t.Cell(count+1,4).range.text:=fdm.TAddstudent.fieldbyname('xb').AsString;
t.Cell(count+1,5).range.text:=fdm.TAddstudent.fieldbyname('csny').AsString;
t.Cell(count+1,6).range.text:=fdm.TAddstudent.fieldbyname('zzmm').AsString;
t.Cell(count+1,7).range.text:=fdm.TAddstudent.fieldbyname('jtzz').AsString;
t.Cell(count+1,8).range.text:=fdm.TAddstudent.fieldbyname('rxsj').AsString;
//t.Cell(count+1,2).range.text:=fdm.TAddstudent.fieldbyname('').AsString;
//t.Cell(count+1,2).range.text:=fdm.TAddstudent.fieldbyname('xjh').AsString;
fdm.TAddstudent.Next;
if count=15 then
begin
pagenum:=pagenum+1;
self.AddNewModalPage(wordapplication1,pagenum);
count:=1;
end else
count:=count+1;
end;
//num := WordDocument1.paragraphs.count; //求得模板中的段落总数为38
//worddocument1.paragraphs.item(num).range.insertafter('aaa');
end;
end;