SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

MS Word VBA to Format T-SQL Text as Rich Text

By K2mission,

This VBA script was written for MS Word. It formats the text and sets default colors for keywords. SQL 2005's Management Studio now does this by default but the previous Query Analyzer did not offer this functionality. This is useful if you prefer to print and review code from time to time (not recommended for printing all scripts due to the cost of color printing). All you have to do is create a macro/module and drop the code in. You can create a button on one of your menus to be able to quickly access it. The code also offers the best rendition of page formatting that I could come up with, considering that MS Word text differs slightly from Query Analyzer, as an option/prompt when running the code.

Total article views: 169 | Views in the last 30 days: 1
Related Articles

Printing Landscape

label printing, zebra s4m 200pdi, pdf, direct print


Printing SSRS Reports

Printing vis Browser


Print Setting and Issues

Print Setting and Issues


duplex printing

reporting service PDF prints both sides


database diagram print on one page

database diagram print