![]() |
|
|
Регистрация | << Правила форума >> | FAQ | Пользователи | Календарь | Поиск | Сообщения за сегодня | Все разделы прочитаны |
![]() |
|
Опции темы | Поиск в этой теме | Опции просмотра |
#1
|
||||
|
||||
![]() Всем привет !
Помогите разобраться, не могу закрыть документ и отключится от процессора MSWORD. Мой вариант кодинга--> Код:
WordApp.Documents.close(adrSaveStr); WordApplication1.Disconnect; Заранее спасибо. |
#2
|
||||
|
||||
![]() Код:
unit Unit1; interface uses ComObj, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; const { WdNewDocumentType constants } wdNewBlankDocument = $00000000; wdNewWebPage = $00000001; wdNewEmailMessage = $00000002; wdNewFrameset = $00000003; { WdSaveFormat constants } wdFormatDocument = $00000000; wdFormatTemplate = $00000001; wdFormatText = $00000002; wdFormatTextLineBreaks = $00000003; wdFormatDOSText = $00000004; wdFormatDOSTextLineBreaks = $00000005; wdFormatRTF = $00000006; wdFormatUnicodeText = $00000007; wdFormatEncodedText = $00000007; wdFormatHTML = $00000008; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var w: OleVariant; begin w:=CreateOleObject('Word.Application'); w.Documents.Add(DocumentType:=wdNewBlankDocument); w.ActiveDocument.SaveAs(FileName:='c:\Downloads\lost.doc', FileFormat:=wdFormatDocument ); w.ActiveDocument.Close; w.Quit; w:=null; end; end. Пишу программы за еду. __________________ |
#3
|
||||
|
||||
![]() Большое спасибо вопрос решен
![]() |