Autor Beitrag
Tower
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 99



BeitragVerfasst: Mi 22.12.04 11:15 
Hallo!

Ich möchte aus meinem Programm heraus ein RTF-File öffnen. Das mache ich über ShellExecute:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
  ShellExecute(
    Application.Handle,
    'open',
    PAnsiChar('"'+FFilename+'"'),
    '',
    nil,
    SW_SHOW
  );


In FFilename steht dann sowas wie "C:\dummy.rtf".

Blöderweise wird damit aber das File IMMER mit Word geöffnet, nicht mit dem Programm, das mit RTF-Dateien assoziiert ist (in meinem Fall OpenOffice).
Sprich: Obwohl zB ein Doppelklick im Explorer auf C:\dummy.rtf OpenOffice öffnet, startet obiger Code Word...

Kann mir jemand sagen, woher das kommt bzw. wie ich das ändern kann?


Danke schonmal!

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 22.12.04 13:27 
Kann es sein, dass bei dir in den Dateitypen 'open' für RTF noch mit Word verbunden ist, aber die Standard-Aktion für RTF, die bei einem Doppelklick ausgeführt wird, nicht 'open', sondern was anderes ist? Z.B. OOopen oder so?

_________________
We are, we were and will not be.
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Mi 22.12.04 13:37 
Könntest du mal bitte in einem Explorer-Fenster auf "Extras" -> "Ordneroptionen..." gehen, dort auf den Reiter "Dateitypen", den Dateityp mit der Endung RTF raussuchen und uns mitteilen, was die Eigenschaften zu diesem Typ sagen? Insbesondere welches Aktion fett gedruckt ist?

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Tower Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 99



BeitragVerfasst: Mi 05.01.05 10:04 
Hi!

(Sorry, Urlaub, jetzt bin ich wieder da)

Wenn ich mir in den Ordneroptionen->Dateitypen die RTF-Einstellungen ansehe, steht unter "Details über die Endung RTF" nur "Öffnen mit: Open Office". Per Ändern-Button kann ich wieder Word einstellen, wenn ich will.
Sonst habe ich da keine Möglichkeiten... (Windows XP)

Oder gucke ich da der falschen Stelle...?
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 06.01.05 17:08 
Wenn da als Verb nur "Öffnen mit: Open Office" steht, dann ist das das Problem. Entweder ein neues Verb hinzufügen oder das alte ändern, und zwar in "open", dann sollte's theoretisch klappen. Evtl noch "open" als Standard-Verb festlegen.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert