解决了问题全部给分

janb 2001-11-20 04:38:03
如何将QuickReport 打印的内容令存为Word 格式?
...全文
812 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
zfmich 2001-11-30
  • 打赏
  • 举报
回复
to janb();
uses Clipbrd;
janb 2001-11-29
  • 打赏
  • 举报
回复
给分
janb 2001-11-21
  • 打赏
  • 举报
回复
怎样送分啊
atongm 2001-11-21
  • 打赏
  • 举报
回复
hei
janb 2001-11-21
  • 打赏
  • 举报
回复
给分也这么难
janb 2001-11-21
  • 打赏
  • 举报
回复
问题解决,给分
janb 2001-11-21
  • 打赏
  • 举报
回复
我想问一下,ClipBoard.SetAsHandle(MyFormat,AData);这一句中的ClipBoard是哪里来的,我定义了一个,但是运行到这里总是出错,我不知道是怎么回事,请指教。
yxjjx 2001-11-21
  • 打赏
  • 举报
回复
佩服,利害
wennn 2001-11-21
  • 打赏
  • 举报
回复
save
blackfiles 2001-11-21
  • 打赏
  • 举报
回复
学习。
janb 2001-11-21
  • 打赏
  • 举报
回复
如果可以,马上给分
thisisxutao 2001-11-21
  • 打赏
  • 举报
回复
可能CSDN系统的问题!!
liang_z 2001-11-20
  • 打赏
  • 举报
回复
学了一招!
zfmich 2001-11-20
  • 打赏
  • 举报
回复
参考这个:

//将报表第iPageNo页存为WORD文件
procedure ReportSaveToDocFile(sFileName :string; iPageNo :integer);
var Template,NewTemplate,ItemIndex:OleVariant;
E: TMetaFile;
B: TBitmap;
MyFormat : Word;
AData : THandle;
APalette : HPALETTE;
begin
try
Template := EmptyParam;
NewTemplate := True;
ItemIndex := 1;
try
Wordapplication.Connect;
except
MessageDlg('Word may not be installed', mtError, [mbOk], 0);
Abort;
end;
Wordapplication.Visible := True;
WordApplication.Caption := 'Delphi automation';
{Create new document}
Template := EmptyParam;
NewTemplate := False;
WordApplication.Documents.Add(Template, NewTemplate);
{Assign WordDocument component}
WordDocument.ConnectTo(WordApplication.Documents.Item(ItemIndex));
{Turn Spell checking of because it takes a long time if enabled and slows down Winword}
WordApplication.Options.CheckSpellingAsYouType := False;
WordApplication.Options.CheckGrammarAsYouType := False;
{Insert data}
B := TBitmap.Create;
E := QRPreview1.QRPrinter.GetPage(iPageNo); //想要第几页
try
with TMetafileCanvas.Create(E, 0) do
try
B.Height := E.Height;
B.Width := E.Width;
B.Canvas.Draw(0, 0, E);
finally
Free;
end;
B.SaveToClipBoardFormat(MyFormat,AData,APalette);
ClipBoard.SetAsHandle(MyFormat,AData);
finally
B.Free;
end;

WordDocument.Sentences.Last.Paste;
except
on E: Exception do
begin
ShowMessage(E.Message);
WordApplication.Disconnect;
end;
end;
end;

5,931

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧