Ver Mensaje Individual
  #2  
Antiguo 03-12-2003
__cadetill __cadetill is offline
Miembro
 
Registrado: may 2003
Posts: 3.387
Reputación: 27
__cadetill Va por buen camino
esto es para pasar un DBGrid al Portapapeles. Supongo que adaptandolo un poco no te costará mucho

Código:
const TAB = #9;
var i       : Integer;
    List    : TStrings;
    StrList : String;
begin
     //*************
     // ********* AÑADE ClipBrd EN EL USES DEL FORM
     //*************

     List := TStringList.Create;

     try
        StrList := '';
        for i := 0 to Pred(RxDBGrid1.FieldCount) Do
            StrList := StrList + RxDBGrid1.Columns[i].Title.Caption + TAB;

        List.Add(StrList);

        Screen.Cursor := crHourGlass;
        while not RxDBGrid1.DataSource.DataSet.Eof do
         begin
              StrList := '';
              for i := 0 to Pred(RxDBGrid1.FieldCount) do
                 StrList := StrList + RxDBGrid1.Fields[i].AsString + TAB;

              List.Add(strList);

              RxDBGrid1.DataSource.DataSet.Next;
         end;

        Clipboard.AsText := List.Text;
     finally
            Screen.Cursor := crDefault;
            FreeAndNil(List);
     end;
end;
Responder Con Cita