AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Schleife abbrechen...

Ein Thema von horst · begonnen am 14. Nov 2003 · letzter Beitrag vom 14. Nov 2003
 
Benutzerbild von Sharky
Sharky

Registriert seit: 29. Mai 2002
Ort: Frankfurt
8.259 Beiträge
 
Delphi 2006 Professional
 
#14

Re: Schleife abbrechen...

  Alt 14. Nov 2003, 11:17
Zitat von horst:
irgendwie klappt das nicht auch wenn ich den button anklicke:
Hai horst,

so kann das auch nicht gehen.

Vergleiche mal meinen Code mit deinem
Delphi-Quellcode:
procedure Delay(msecs:integer);
var
  FirstTickCount:longint;
begin
  FirstTickCount:=GetTickCount;
  repeat
    Application.ProcessMessages; {allowing access to other controls, etc.}
  until ((GetTickCount-FirstTickCount) >= Longint(msecs));
end;

{****************************************************}

procedure TForm1.Button1Click(Sender: TObject);
var
  ndx : Integer;
  FileName: OleVariant;
  i, j: Integer;
  s: string;
begin
  Button1.Enabled := False;
  ndx := 1;
  abbruch := false;
  while (ndx < StringGrid1.RowCount - 1) and (not abbruch) do
    begin
      s := StringGrid1.Cells[8, i];
      with TRegistry.Create do
        try
          RootKey := HKEY_CURRENT_USER;
          if OpenKey('\Software\VB and VBA Program Settings\FRITZ!fax\Print', True) then
            begin
              WriteString('Microsoft Word - test.doc', s);
            end;
        finally
          CloseKey;
          Free;
          WordApplication1.Connect;
          Application.ProcessMessages;
          FileName := 'C:\test.doc';
          WordApplication1.Documents.Open(FileName, EmptyParam, EmptyParam, EmptyParam,
            EmptyParam, EmptyParam, EmptyParam, EmptyParam,
            EmptyParam, EmptyParam);
          WordDocument1.Close;
          WordApplication1.PrintOut;
          Delay (3000);
          WordDocument1.Disconnect;
          inc(ndx);
          Application.ProcessMessages;
        end;
    end;
end;

{****************************************************}

procedure TForm1.Button2Click(Sender: TObject);
begin
  abbruch := True;
  Button1.Enabled := True;
end;
Stephan B.
"Lasst den Gänsen ihre Füßchen"
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:19 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz