Autor Beitrag
rego
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Fr 26.08.05 16:05 
hi,

folgendes: ich will eine Datei (name Texte.deu oder texte.eng) mit einem button in einem word dokument öffnen. mein delphi spuckt mir keine hilfe über WordDocument1 aus und ich komm mal wieder nicht weiter :/

(Delphi5)

über schnelle hilfe wär ich dankbar

rego


Moderiert von user profile iconChristian S.: Topic aus CLX / Delphi Language (Object-Pascal) verschoben am Fr 26.08.2005 um 17:38
rego Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Fr 26.08.05 16:39 
es scheint nicht zu gehen, weil ich kein word97 drauf habe
weiss einer ob ich stattdessen auch das in windows integrierte word öffnen kann ?
LigH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 239

Win98SE, Win2000SP4
D7
BeitragVerfasst: Fr 26.08.05 17:09 
Windows hat kein Word integriert.

Was du eventuell meinst (WordPad), ist ein Rich-Text-Editor, der zusätzlich noch Word-6-Dokumente importieren kann. Eine RichEdit-Komponente bietet Delphi an, und wie man damit umgeht, wird alle paar Wochen immer wieder mal aufs neue erklärt für die, die die Boardsuche nicht bedienen können.
rego Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Mo 29.08.05 09:20 
Eben diese kann ich nicht bedienen, denn wenn ich auf den schönen "Suche" Button klicke, öffnet sich ein noch schöneres Fenster mit dem Inhalt, dass diese Seite nicht aufrufbar ist. Grund daran ist das noch noch schönere Programm der Firma, welches bestimmte Internetseiten sperrt und leider auch diesen Suchbutton. Warum ? Keine Ahnung.
rego Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Mo 29.08.05 10:04 
ich glaube du hast mich nicht ganz verstanden.

Ich möchte, dass Delphi einen Editor per Knopfdruck öffnet, in dem sich eine Datei öffnet, die von Delphi erstellt wurde durch einen anderen Knopfdruck. Dieser Editor soll die Fähigkeit besitzen, diese Datei ändern und neu abspeichern zu koennen.

Es geht mir nicht darum sie anzuzeigen.

P.S. Ahnung von Richedit habe ich absolut gar keine
Harry M.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754

Win 2000, XP
D2005
BeitragVerfasst: Mo 29.08.05 10:09 
Na einfach mit ShellExecute, WinExec usw die Datei aufrufen und als Parameter die Datei+Path angeben die geöffnet werden soll. Habe ich zwar jetzt nicht getestet solle aber gehen.

_________________
Gruß Harry
Et spes me per dies sine te ducat et amor me ferat, si dolor spem tollit.
rego Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Mo 29.08.05 10:20 
öhm, wie ?
Land-Gull
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 51

SuSe 9.2, WIN XP
D7 Enter
BeitragVerfasst: Mo 29.08.05 10:34 
Hi,

probiers mal mit WinExec('Wordpad.exe',SW_Show) dann öffnet sich allerdings kein Dokument drin.
Daher würd ich dir
ausblenden Delphi-Quelltext
1:
ShellExecute(0,nil,'wordpad.exe','Der Pfad deiner Datei',nil,SW_Show);					

empfehlen.

Denk drann bei uses aber noch shellApi hinzuzufügen.
rego Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Mo 29.08.05 10:57 
nur noch ein klitzekleines Problem:
wie wandel ich string in PChar um ?

P.S. danke
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mo 29.08.05 10:59 
PChar();
rego Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Mo 29.08.05 11:06 
geht irgendwie nicht :/

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button3Click(Sender: TObject);
begin
 // Application.CreateForm(TEditForm, EditForm);
 // MessageDlg('Bitte Sprache auswählen', mtInformation,[mbOk], 0);
  TempStr1 := 'C:\SPSTXTVW\''TEXTE.' + Suffix(Sprache);
 // EditForm.Open(TempStr1);
 // EditForm.ShowModal;
 PChar(TempStr1);
 ShellExecute(0,nil,'wordpad.exe',TempStr1,nil,SW_Show);


end;


so schaut das aus aber kommt fehlermeldung:
Anweisung erforderlich aber Ausdruck vom Typ 'PChar' gefunden {Zeile 8} &
Inkompatible Typen String und PChar {Zeile 9}
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mo 29.08.05 11:26 
PChar ist eine Funktion. Sie erwartet einen String als Parameter und gibt einenPChar zurück. Also musst du schreiben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button3Click(Sender: TObject);
begin
 // Application.CreateForm(TEditForm, EditForm);
 // MessageDlg('Bitte Sprache auswählen', mtInformation,[mbOk], 0);
  TempStr1 := 'C:\SPSTXTVW\''TEXTE.' + Suffix(Sprache);
 // EditForm.Open(TempStr1);
 // EditForm.ShowModal;
 ShellExecute(0,nil,'wordpad.exe',PChar(TempStr1),nil,SW_Show);


end;

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
MrSaint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1033
Erhaltene Danke: 1

WinXP Pro SP2
Delphi 6 Prof.
BeitragVerfasst: Mo 29.08.05 11:32 
PChar ist keine Funktion! Es ist ein TypeCast!
Siehe Motzis Tutorial auf www.manuel-poeter.de für mehr Infos :)


MrSaint

_________________
"people knew how to write small, efficient programs [...], a skill that has subsequently been lost"
Andrew S. Tanenbaum - Modern Operating Systems
rego Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Mo 29.08.05 11:43 
Herzlichsten Dank an alle die mir immer helfen, ihr seids Spitze :)

und so langsam bekomm ich spass an delphi, obwohl ich hier für anfänger killerprogramme bearbeiten muss. Ma sehen vielleicht gibts für mich newbie doch noch chancen irgendwann das programm zu beherrschen :P