The attempt is to copy text in clipboard with "Tab" separator for successive Ctrl+V in word document, then selecting it inside Word add a grid around that text.
I did the code below and this works
var
StrGrdExc : TStringGrid;
procedure TFrmMain.ToolButton4Click(Sender: TObject);
var
iR, iC : integer;
Str1 : string;
begin
Clipboard.AsText:='';
for iR:=1 to StrGrdExc.RowCount-1 do begin
Str1:='';
for iC:=1 to StrGrdExc.ColCount-1 do begin
Str1:=Str1+StrGrdExc.Cells[iC, iR];
if iC <> StrGrdExc.ColCount-1 then
Str1:=Str1+#9
end;
Clipboard.AsText:=Clipboard.AsText+Str1+#13#10;
end;
end;
is that the right way to do that ?
(Windows 10, LAZ 2.0.12, FPC 3.0.2)
thank you in advance.