刚刚接触delphi,导师让我修改一个题库系统 其中一个模块是调用word显示题目(题目存在word文档中)
其中有一段代码是
procedure TmanalselectpaperForm.createpaper;     var docs,Template,NewTemplate,Itemindex,a:oleVariant;
var Index,sFile,bFlag:OleVariant;
var s: Selection;
var timufile,timuSQL,temptixing:string;
var shitii,jj:integer;
var findmaxID,tom:string;
var ipp:integer;
begin
  WordApplication1.Connect;
  WordApplication1.Visible:=true;
  docs:= WordApplication1.Documents;
  docs.add(NewTemplate:=False);
  itemindex:=1;
  WordDocument1.ConnectTo(WordApplication1.Documents.Item(itemindex));
  s:=WordApplication1.Selection;编译时,delphi报错
信息是  var s: Selection;Undeclared identifier: 'Selection'
请问 为什么会出现这个报错 我用的word是2007版本的 是不是与版本有关
我在网上查阅相关问题,其中有段代码也是var s: Selection; 但是没提到有错误出现
恳请各位前辈帮我解答下,不胜感激