delphi 提示“Undeclared identifier:'wdOrientLandscape'”,请高手指教procedure TWordForm.BitBtn2Click(Sender: TObject);
var
WordApp,WordDoc,WordTable:OleVariant;
begin
WordApp:=CreateOleObject('Word.Application');
WordDoc:=WordApp.Documents.Add;
WordApp.ActiveDocument.PageSetup.Orientation:=wdOrientLandscape;//将纸张调为横向
WordApp.quit;
WordApp:=null;
WordDoc:=null;
WordTable:=null;
end;
var
WordApp,WordDoc,WordTable:OleVariant;
begin
WordApp:=CreateOleObject('Word.Application');
WordDoc:=WordApp.Documents.Add;
WordApp.ActiveDocument.PageSetup.Orientation:=wdOrientLandscape;//将纸张调为横向
WordApp.quit;
WordApp:=null;
WordDoc:=null;
WordTable:=null;
end;
我机器上Word 9.0 (Office 2000) 是 wdOrientLandscape = $00000001;
就是常量wdOrientLandscape 相当于1了