Entonces puedes probar con esto:
Código Delphi
[-]procedure GuardarTreeToFile(Arbol: TTreeview; Memo:TstringList);
const
LineaVer = ' '+'|';
LineaHor = '-----';
FindeLinea = #13#10;
var
I: Integer;
ANode: TTreeNode;
NodeStr: TStringBuilder;
Buffer, Preamble: TBytes;
begin
NodeStr := TStringBuilder.Create(1024);
try
ANode := Arbol.items[0];
while ANode <> nil do
begin
NodeStr.Length := 0;
for I := 0 to ANode.Level - 1 do NodeStr.Append(LineaVer);
if anode.Level>0 then nodestr.Append(lineahor);
NodeStr.Append(ANode.Text);
NodeStr.Append(Findelinea);
memo.Add(nodestr.ToString);
ANode := ANode.GetNext;
end;
finally
NodeStr.Free;
end;
end;
Tal vez, es lo que necesitas.
Saludos