Re: Urgent: How do i transfer the delphi code to a word document efficiently.


[ Delphi Forum ] [ Delphi Tutorials -- by DelphiLand ]

Posted by webmaster Guido on August 07, 2003:

In Reply to: Urgent: How do i transfer the delphi code to a word document efficiently. posted by p12297 on August 06, 2003:

: I need to transfer all my delphi codes to a word document for my report, but i am facing difficulty doing that. what is the easiest way, else how can i print the delphi files with page numbers i want to assign in the bottom, and with appropriate margins, lets say 1.5" on the left. Please someone write asap if you know

-----------

If you mean "copy all of the text of the project file and the unit-files to a Word doc", here are a few tricks to do it manually:

1. Create a new Word doc and enter this text:
*.dpr; *.pas
Copy this text to the clipboard and next remove it form the Word document. Just a trick to have that filemask handy for the rest of the procedure ;-)

2. In the menu, select "Insert / File"

3. In the "Open" dialog box, navigate to the folder that contains your Delphi project. Next, paste the text "*.dpr; *.pas" from the clipboard in the File Name box.
Next, press ENTER (don't click the Open button yet!)

4. In the dialog box that is still open, you'll see a list of all .dpr and .pas files. Select the first file that you want and click the Insert button.

5. Add some separation below the text, (horizontal line, pagebreak,...)
Repeat steps 4 and 5 for all the files. This works quite fast, as you don't have to type anything (each time, paste the filemask with Ctrl+V)

6. Apply some make-up as desired: set up the margins in Word's Page Setup, select the entire text and apply a non-proportioanl font like Courier New, and so on...
To add a footer with page numbering: menu "View / Header and Footer", switch to Footer with the appropriate speedbutton, next insert a page-number (also with a speed button).

Maybe you have lots and lots of files, and you want to automate this? I'll have a look if I find any quick solutions (there must be some faster ways to assemble all the text file into one larger file, and next import that in Word).

...or maybe I misunderstood your question? In that case, don't hesitate to write again!


 

Related Articles and Replies:


[ Delphi Forum ] [ Delphi Tutorials -- by DelphiLand ]