Autor Beitrag
majolo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: Mi 05.03.03 20:31 
Hallo,

ich habe ein kleines Problem. ich wollte eine rtf Datei im Richedit öffnen. hat leider nicht so ganz geklappt ich bekam sowas raus
ausblenden Quelltext
1:
2:
3:
{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1031{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}

{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f15\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f106\fswiss\fcharset238\fprq2 Tahoma CE;}

usw. irgendwann kam auch mal Text.
Muss man irgendwas besonderes beachten? Ich meine,dass das bei mir ohne Probleme mal geklappt hat.
Danke im vorraus.

Gruss
majolo
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Mi 05.03.03 20:35 
Also der Text weist eigentlich darauf hin, dass du es in keinem RichEdit geöffnet hast, sondern, dass du ein Memo genommen hast. Öffne die Datei mal in Word. Wenn das geht muss das auch im RichEdit gehen.

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Mi 05.03.03 20:58 
Soll der im Steuerelement enthaltene Text im RTF-Format in eine normale Textdatei geschrieben werden, muß die Eigenschaft PlainText vor der Schreiboperation auf True gesetzt werden. Um die in einer Datei enthaltenen RFT-Informationen zu ignorieren, muß die Eigenschaft vor dem Einlesen der Datei in das Steuerelement ebenfalls auf True gesetzt werden. Sollen die RTF-Attribute beim Lesen oder Schreiben einer Datei erhalten bleiben, setzen Sie PlainText auf False.
majolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: Mi 05.03.03 21:30 
Also RichEdit habe ich verwendet und das mit dem Plaintext habe ich auch gewusst und ausgeführt. Ich stehe vor einem Rätsel.
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Mi 05.03.03 21:36 
Wie gesagt, öffne die Datei mal in Word und sieh dir das mal an. Wenn es da immer noch so aussieht hast du wirklich ein Problem.

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
majolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: Mi 05.03.03 21:41 
Die Datei sieht in Word ganz normal aus.
majolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: Mi 05.03.03 21:56 
Kann es vielleicht daran liegen,dass die Datei auf einem Server liegt und es deshalb nicht klappt. Ich kenne mich ehrlich gesagt mit Internet und so weiter nicht aus. habe mal sowas zusammengebastelt, mit txt- Files klappts, aber nicht mit rtf-Dateien:
ausblenden Quelltext
1:
2:
NMHTTP1.Get(edit1.Text);
Richedit1.Text:= StringReplace(NMHTTP1.Body, #10, #13#10, [rfReplaceAll]);

ziemlich einfach.Manche werden mich lynchen,aber könnte da der Fehler drin liegen?

Gruss
majolo
majolo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 334

Ubuntu 8.04, WinXP Prof.
D1, D6Pers, D7 Prof., D8 Prof., D2005 Pers
BeitragVerfasst: Sa 08.03.03 14:18 
Hi Leute,

habe das Problem gelöst, dank Hilfe der Schweizer Kollegen.Für alle die sich dafür interessieren hier der Code:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var 
ms: TMemoryStream; 
begin 
  ms := TMemoryStream.Create; 
  try 
    idHttp1.Get('http://urlzumeinem/test.rtf', ms); 
    ms.Position := 0; 
    RichEdit1.Lines.LoadFromStream(ms); 
  finally 
    ms.Free; 
  end; 
end;

PlainText auf false einstellen.

Gruss
majolo