{"id":485,"date":"2008-05-07T07:20:07","date_gmt":"2008-05-07T07:20:07","guid":{"rendered":"http:\/\/6teen.ru\/?p=659"},"modified":"2008-05-07T07:20:07","modified_gmt":"2008-05-07T07:20:07","slug":"8762","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=485","title":{"rendered":"\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Word \u0447\u0435\u0440\u0435\u0437 OLE"},"content":{"rendered":"<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Word \u0447\u0435\u0440\u0435\u0437 OLE<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Word \u0447\u0435\u0440\u0435\u0437 OLE\n\n\u042f \u0434\u0443\u043c\u0430\u044e, \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0440\u0430\u0441\u043d\u043e\u0440\u0435\u0447\u0438\u0432\u0435\u0435 \u043f\u044f\u0442\u0438 \u043b\u0438\u0441\u0442\u043e\u0432 \u0441\u043b\u043e\u0432\u043e\u0431\u043b\u0443\u0434\u0438\u044f ...\n\nunit Unit1;\ninterface\nuses\nWindows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,\nButtons, ComCtrls, ExtCtrls, OleCtnrs;\ntype\nTForm1 = class(TForm)\nOleContainer1: TOleContainer;\nPanel1: TPanel;\nStatusBar1: TStatusBar;\nmbLoad: TSpeedButton;\nmbPrint: TSpeedButton;\nOpenDialog1: TOpenDialog;\nprocedure mbLoadClick(Sender: TObject);\nprocedure mbPrintClick(Sender: TObject);\nprivate\n{ Private declarations }\npublic\n{ Public declarations }\nend;\nvar\nForm1: TForm1;\nimplementation\n{$R *.DFM}\nprocedure TForm1.mbLoadClick(Sender: TObject);\nbegin\n\/\/ \u041f\u043e\u043a\u0430\u0436\u0435\u043c \u0434\u0438\u0430\u043b\u043e\u0433,\n\u0438 \u0435\u0441\u043b\u0438 \u043e\u043d \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\nif OpenDialog1.Execute and!\n(OpenDialog1.FileName>'') then\nOleContainer1.CreateObjectFromFile(OpenDialog1.FileName,false);\n\/\/ \u0415\u0441\u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c, \u0442\u043e \u043f\u043e\u043a\u0430\u0436\u0435\u043c\nif OleContainer1.State > osEmpty then\nOleContainer1.DoVerb(ovShow);\nend;\nprocedure TForm1.mbPrintClick(Sender: TObject);\nvar\nV : Variant;\nbegin\nif OleContainer1.State = osEmpty then Begin\nMessageDlg('OLE \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d !!', mtError, [mbOk],0);\nexit;\nend;\n\/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u043f\u043b\u043e\u0449\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 WordBasic \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\nV := OleContainer1.OleObject.Application.WordBasic;\n\/\/ \u041a\u043e\u043c\u0430\u043d\u0434\u0443\u0435\u043c \u0434\u043e \u043e\u0434\u0443\u0440\u0435\u043d\u0438\u044f ....\nV.FilePrint;\nend;\nend.\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 Word \u0447\u0435\u0440\u0435\u0437 OLE<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,418],"tags":[1105,1925],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/485"}],"collection":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=485"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/485\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=485"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}