From: "Peter Below (TeamB)" <100113.1101@compuXXserve.com> Subject: Re: Treeview -> how to print it? Date: 25 Aug 1999 00:00:00 GMT Message-ID: Content-Transfer-Encoding: 8bit References: <37c690be.76006588@forums.borland.com> Content-Type: text/plain; charset=iso-8859-1 Organization: TeamB Mime-Version: 1.0 Reply-To: 100113.1101@compuXXserve.com Newsgroups: borland.public.delphi.objectpascal In article <37c690be.76006588@forums.borland.com>, Richey / Delphi-Box wrote: > ...is there an easy way (without 3rd party components etc.) ? > I just want to dump the contents to a printer, without "complicated" > formatting etc. > Here is a possible approach (untested ): Procedure DumpTreeviewToTextfile( Var F: Textfile; tree: TTreeview ); Var node: TreeNode; Begin node:= tree.Items.GetFirstnode; While node <> Nil Do Begin WriteLn(F, StringOfChar(' ', 2* node.Level ), node.Text ); node := node.GetNext; End; { While } End; Var F: Textfile; Begin AssignPrn( F ); Rewrite(F); try DumpTreeviewToTextfile( F, treeview1 ); finally closefile(F); end; End; Peter Below (TeamB) 100113.1101@compuserve.com) No e-mail responses, please, unless explicitly requested!