• VBA: Printing code in color (VBA – Office 2000)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » VBA: Printing code in color (VBA – Office 2000)

    Author
    Topic
    #359351

    I recently completed a project (an on-line order form created using Excel…thanks to mucho help from this forum salute ) and wanted to print out the final form as well as the macros and user forms it contains. The form itself prints in glorious color but I can’t find a way to get the code to print in color. I’m wanting it that way so that the green comment lines are easier to pick out.

    I could copy/paste the whole thing into Word or something and set the font attributes for lines that start with the apostrophe to green (or red or whatever)….but

    Is there a way to get the code to print in color from the VB Editor?? scratch

    Thanks!
    Sue

    Viewing 0 reply threads
    Author
    Replies
    • #538431

      When printing the code from VB, did you try File, Print and click Setup and select the appropriate printer ?

      Andrew C

      • #538524

        Yes. I have a color printer selected and the setup for the printer is to print in color.

        I’ve tried several different color printers and the code output always comes out black-only. User Forms print in color, though.

        Thanks!
        Sue

        • #538537

          Sorry Sue but this all Microsoft has to offer :

          [indent]


          SYMPTOMS
          In the products listed at the beginning of this article, certain lines of Microsoft Visual Basic for Applications code in a module appear in color while you are editing them. However, when you print the module, these lines of code are printed in black and white, even if you have a color printer.

          CAUSE
          Printing of color in modules is not a supported feature.


          [/indent]

          The above is from KB artice Q173083

          Andrew

          • #538538

            Andrew,

            Just seconds before you posted this, I (finally! doh ) thought to check the knowledge base and found the same article. I’m so used to thinking of the Lounge as the fount of all knowledge that I forget about KB sometimes… blush

            Thanks!
            Sue

            • #538738

              Sue,

              I have come across a product that might hekp you at StarPrint2000. They vahe various products for different source code printing and formatting. They have trial versions avavilable for download, but I cannot say whatt restrictions are in force. It maybe worth a look for you.

              Andrew

            • #538753

              Andrew,

              I checked it out and Yes! That is just what I’m looking for. Thanks! bravo

              The trial version restrictions are that it will only print the first 3 pages of code. As near as I can tell, all other functions work as they would in the unrestricted version. It is fairly flexible (you can set your own colors and fonts for various components, page margins, headers/footers, etc) and it certainly makes the code more readable.

              Sue

            • #538841

              Hi,

              Was just nosing around the msofficepro.com site, and came across this free download – haven’t tried it, but this looks to do what you need, and the price is right.
              [indent]


              This add-in enables you to print the Microsoft VBA source code in color of your applications across the entire Microsoft Office 2000 suite of applications: Word, Excel, Outlook, Access, PowerPoint, and FrontPage and any other VBA enabled software.
              You can create and save your own output styles by customizing the fonts and colors settings for keywords, strings, constants, procedure headers, line numbers, page headers/footers. You can customize the page margins, line spacing, print quality, paper orientation, scaling, and much more.


              [/indent]Gary

            • #538876

              Gary,

              Yep. That’s the same add-in Andrew mentioned…just from a different source. The free download is a reduced-function version of the full-blown add-in.

              Thanks!
              Sue

            • #540970

              Another option is PrettyCode.Print from vbcity.com, http://www.vbcity.com/page.asp?p=pcp_index

              I use it in VB to print in color and can put any VBA in it from the clipboard.

              It’s also nice in that it shows your loops.

              Just my $.02

              Abraxus

    Viewing 0 reply threads
    Reply To: VBA: Printing code in color (VBA – Office 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: