Autor Beitrag
ingo.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: So 15.05.05 14:59 
Hy,

ich habe auf meinem Rechner Windows XP Prof. und Office XP installiert. Ein Freund hat ebenfalls Windows XP, aber Office 2000. Mein kleines Tool funktioniert bei mir fehlerfrei, führt aber bei meinem Freund zu einem Programmabsturz. Hoffe kann mir jemand weiterhelfen, was ich umschreiben muss, dass es auf beiden Versionen von Office läuft.


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
  for a:=0 to Form1.listbox1.items.count-1 do
   begin
     if AnsiLowerCase(copy(Form1.ListBox1.Items[a],1,1))<> AnsiLowerCase(Startchar) then
      begin
        if a<>0 then
        begin
         Wordapplication1.Selection.TypeParagraph;
         Wordapplication1.Selection.TypeParagraph;
        end;

        Startchar := AnsiUpperCase(copy(Form1.ListBox1.Items[a],1,1));
        Wordapplication1.Selection.Tables.Add(wordapplication1.Selection.Range,1,1,emptyparam,emptyparam);
        Wordapplication1.Selection.shading.BackgroundPatternColor:=wdColorGray25;

        Wordapplication1.Selection.Font.Size:=16;
        Wordapplication1.Selection.Font.Bold:=1;
        Wordapplication1.Selection.TypeText(Startchar);

        Wordapplication1.Selection.MoveDown(emptyparam,emptyparam,emptyparam);
        Wordapplication1.Selection.TypeParagraph;
        Wordapplication1.Selection.TypeText(Form1.ListBox1.Items[a]+#13#10);
      end
      else
      begin
        Wordapplication1.Selection.TypeText(Form1.ListBox1.Items[a]+#13#10);
      end
   end;


Das Tool schreibt die Zeilen einer Listbox in ein Worddokument, alphabetisch geordnet. Der jeweilige "neue" Buchstabe wird farblich hervorgerufen.


MFG

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Mi 18.05.05 21:07 
kannst du "Programmabsturz"genauer beschreiben? Gibt es Fehlermeldungen?

Ich sehe auf Anhieb nichts, was Probleme bereiten könnte. WinXP habe ich nicht, aber unter W2K+Word2000 und W2K+WordXP guibts keine Probleme.
welche Serverkompos hast du beim installieren gewählt?

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
ingo. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Do 19.05.05 21:35 
Hy,

hab nachgefragt. Er meint das Prog hängt sich auf, sobald der Code ausgeführt wird (wird duch einen Klick gestartet). Das Prog kann dann nur noch über den Taskmanager beendet werden. Hat ne Prozessauslastung von 100%.

MFG
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Di 24.05.05 18:13 
hm, keine Ahnung, XP habe ich nicht.
Ich würde an deiner Stelle an den wichtigsten Punkten mal ein paar showmessages einbauen oder ein logfiel schreiben, damit du siehst, bis wohin dein Programm kommt.
Probleme, das das delphi-Programm in Verbindung mit Word nicht mehr reagiert, habe meistens nur, wenn der Anwender bereits irgendeinen Dialog in Word geöffnet hat.

Mfg frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)