程序中用OleContainer显示Word文档,使用
OleContainer1->CreateObjectFromFile("E:\\temp.doc",false);
OleContainer1->DoVerb(ovShow);
却把菜单栏和工具栏都显示出来了。去掉OleContainer1->DoVerb(ovShow)语句,出现两个问题:
1、双击Word文档,整个Form都变成了Word编辑区
2、不双击Word文档,文档无法滚动
如何解决这两个问题?
有没有更好的办法?
多谢了!
OleContainer1->CreateObjectFromFile("E:\\temp.doc",false);
OleContainer1->DoVerb(ovShow);
却把菜单栏和工具栏都显示出来了。去掉OleContainer1->DoVerb(ovShow)语句,出现两个问题:
1、双击Word文档,整个Form都变成了Word编辑区
2、不双击Word文档,文档无法滚动
如何解决这两个问题?
有没有更好的办法?
多谢了!
[email protected]
多谢
(其实也是没有办法的办法)用TWebBrowser!来Navigate你的Word文档,齐活!
和你的程序融为一体,不出现word工具栏和主菜单。
只是可以编辑,有标尺、右键菜单,而且第一次打开速度慢些。
Word:Variant;
activerow: integer;
begin
Word:=CreateOLeObject('Word.application');
word.documents.add(Template:='f:\mynew.ttk.dot');
word.selection.endkey;
newword.activedocument.Paragraphs.add;
activerow:=newword.activedocument.Paragraphs.count;
newword.activedocument.paragraphs.item(activerow).range.text:='哈哈,加进去了。';//这里加入
end;