1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37:
| uses Word,Printers;
{$R *.nfm}
procedure TWordTester.Button1Click(Sender: TObject); var vMSWord : word.Application; obj : TObject; fn, ovTrue, OvFalse, ovis, oCC, oRO: TObject;
begin if opendialog1.Execute then begin obj := TObject.Create; fn:=TObject(OpenDialog1.FileName); ovTrue := TObject(true); ovFalse := TObject(false); ovis := TObject(false); oCC := TObject(false); oRO := TObject(false); vMSWord := Word.ApplicationClass.Create;
vMSWord.ActivePrinter:=Printer.Printers[Printer.PrinterIndex]; vMSWord.Documents.Open(fn, oCC, oRO, ovFalse, obj, obj, obj, obj, obj, obj, obj, ovis); vMSWord.Activate; vMSWord.PrintOut(ovfalse, obj, obj, obj, obj, obj, obj, obj, obj, obj, obj, obj, obj, obj, obj, obj, obj, obj,obj); vMSWord.Quit(ovFalse,obj,obj); end; end; |