How to: Print Code in the Editor
The integrated development environment (IDE) provides many of the familiar print features available from your operating system, along with a few features specific to Visual Studio. For example, you can include line numbers or omit collapsed regions in print outs, as well as include the file name and page numbers.
Note
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.
Print line numbers
The line numbers displayed in the Code Editor do not print by default. In addition, you can choose to print line numbers even if line numbers do not appear in the Code Editor.
To print line numbers
On the File menu, click Print.
In Print what, select Include line numbers.
Click OK.
Print current view
You can choose to only print the content currently viewable in the Code Editor, omitting collapsed regions.
To print the current view of a file
On the File menu, click Print.
In Print what, select Hide collapsed regions.
Click OK.
Print file name, path, and page numbers
You can choose to include a header on print outs that includes the full path and name for the file being printed, as well as page numbers.
To print file name, path, and page numbers
On the File menu, click Page Setup.
Select Page header.
Click OK.
On the File menu, click Print.
Click OK.
Print in a different font than appears in the Code Editor
You can choose to print text in a different font face and size than the font face and size that you use when editing in the Code Editor.
To print using a font that is different than the font in the Code Editor
On the Tools menu, choose Options.
Expand Environment, and then click Fonts and Colors.
In Show settings for, select Printer.
In Font, select a different font face for printing.
In Size, select a different font size for printing.
Click OK.
Color printing
When you print multicolor text, code, or forms on a printer that supports color printing, the font and color of certain items as printed can differ from those used in the Code Editor.
The Fonts and Colors, Environment, Options Dialog Box allows you to save different settings for Text Editor and Printing. When these settings differ, the printed output might not match what you see displayed in the Code Editor.