Autor Beitrag
MisterBum83
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 245
Erhaltene Danke: 2

WIN XP
Delphi 6
BeitragVerfasst: Mi 06.02.13 11:03 
Hallo zusammen,

ich baue mittels

ausblenden Delphi-Quelltext
1:
2:
FMSWord: variant;
FMSWord := CreateOleObject('Word.Basic');


eine Verbindung zu Word her. Wenn ich diese über unassigned freigebe, bleibt der Prozess winword.exe noch aktiv.

Wenn ich versuche, mittels

ausblenden Delphi-Quelltext
1:
2:
FMSWord.Quit(wdDoNotSaveChanges, EmptyParam, EmptyParam);
FMSWord.Disconnect;


den Prozess versuche zu beenden, dann kommt die Meldung "Quit wird vom Automatisierungsobjekt nicht unterstützt.
Jemand eine Idee warum, bzw. wie bekomme ich anders den Prozess beendet?

Gruß MisterBum
thepaine91
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 763
Erhaltene Danke: 27

Win XP, Windows 7, (Linux)
D6, D2010, C#, PHP, Java(Android), HTML/Js
BeitragVerfasst: Mi 06.02.13 14:59 
Also laut Dokumentation sollte das funktionieren. Dort wird allerdings "Word.Application" verwendet.

Unter Umständen hilft dir das weiter.
Tranx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 648
Erhaltene Danke: 85

WIN 2000, WIN XP
D5 Prof
BeitragVerfasst: Do 07.02.13 11:45 
Schaue mal hier nach:

www.delphi-treff.de/...-automation-steuern/

Dort steht bei "Word.Basic" etwas von "früheren Versionen". Das kann schon erklären, dass das so nicht funktioniert.

_________________
Toleranz ist eine Grundvoraussetzung für das Leben.
MisterBum83 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 245
Erhaltene Danke: 2

WIN XP
Delphi 6
BeitragVerfasst: Fr 08.02.13 18:52 
Wenn ich auf Word.Application umsteige, dann klappt leider der Rest von meinem Programm nicht mehr. Daher muss ich bei Word.Basic bleiben.

Sonst keiner eine Idee?
Tranx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 648
Erhaltene Danke: 85

WIN 2000, WIN XP
D5 Prof
BeitragVerfasst: Fr 08.02.13 19:05 
Entschuldige, aber das verstehe ich nicht. Wo definierst Du denn die Variant-Variable für Word? Global? Lokal?

Wenn es global ist, dann versuche es doch mal mit einer lokalen Definition, dann sollte das klappen. Allerdings scheint es nun mal so, dass Word.Basic offensichtlich nur für frühere Word-Versionen funktioniert, während Word.Application bei den neueren Versionen funktioniert. Es mag ja sein, dass Du mit Word.Basic Word starten kannst. Aber anscheinend eben nicht beenden. Oder versuche es doch mit

ausblenden Delphi-Quelltext
1:
  FMSWord.Free;					


Aber möglicherweise wird damit Word auch nicht beendet. Ein Versuch wäre es Wert.

_________________
Toleranz ist eine Grundvoraussetzung für das Leben.
Gerd Kayser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 632
Erhaltene Danke: 121

Win 7 32-bit
Delphi 2006/XE
BeitragVerfasst: Fr 08.02.13 19:31 
user profile iconMisterBum83 hat folgendes geschrieben Zum zitierten Posting springen:
Daher muss ich bei Word.Basic bleiben.


Versuchs mal mit:
Zitat:
Word.FileExit(1);
quits Word, saving any modified file. If you pass 2 as the parameter, files are not saved; if the parameter is 0 or omitted, the user is prompted."


Quelle: www.djpate.freeserve...ord.htm#WordStarting

Für diesen Beitrag haben gedankt: MisterBum83
MisterBum83 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 245
Erhaltene Danke: 2

WIN XP
Delphi 6
BeitragVerfasst: Mo 11.02.13 10:34 
Zitat:
Word.FileExit(1);
quits Word, saving any modified file. If you pass 2 as the parameter, files are not saved; if the parameter is 0 or omitted, the user is prompted."

Quelle: www.djpate.freeserve...ord.htm#WordStarting


Das war die Löung. DANKE!