Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Iowa, USA
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA: Printing code in color (VBA - Office 2000)

    I recently completed a project (an on-line order form created using Excel...thanks to mucho help from this forum <img src=/S/salute.gif border=0 alt=salute width=15 height=20> ) 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?? <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

    Thanks!
    Sue

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: VBA: Printing code in color (VBA - Office 2000)

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

    Andrew C

  4. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Iowa, USA
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA: Printing code in color (VBA - Office 2000)

    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

  5. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: VBA: Printing code in color (VBA - Office 2000)

    Sorry Sue but this all Microsoft has to offer :

    <hr>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. <hr>

    The above is from KB artice <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q173/0/83.ASP?>Q173083</A>

    Andrew

  6. #5
    Star Lounger
    Join Date
    Jan 2001
    Location
    Iowa, USA
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA: Printing code in color (VBA - Office 2000)

    Andrew,

    Just seconds before you posted this, I (finally! <img src=/S/doh.gif border=0 alt=doh width=15 height=15> ) 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... <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

    Thanks!
    Sue

  7. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: VBA: Printing code in color (VBA - Office 2000)

    Sue,

    I have come across a product that might hekp you at <A target="_blank" HREF=http://www.jn-software.com/> StarPrint2000</A>. 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

  8. #7
    Star Lounger
    Join Date
    Jan 2001
    Location
    Iowa, USA
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA: Printing code in color (VBA - Office 2000)

    Andrew,

    I checked it out and Yes! That is just what I'm looking for. Thanks! <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

    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

  9. #8
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 28 Times in 27 Posts

    Re: VBA: Printing code in color (VBA - Office 2000)

    Hi,

    Was just nosing around the msofficepro.com site, and came across this <A target="_blank" HREF=http://www.msofficepro.com/vbapowertools/showfile.asp?FileID=1736>free download</A> - haven't tried it, but this looks to do what you need, and the price is right.
    <hr>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.
    <hr>
    Gary

  10. #9
    Star Lounger
    Join Date
    Jan 2001
    Location
    Iowa, USA
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA: Printing code in color (VBA - Office 2000)

    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

  11. #10
    3 Star Lounger
    Join Date
    Sep 2001
    Location
    Stuck at work..., Missouri, USA
    Posts
    248
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA: Printing code in color (VBA - Office 2000)

    Another option is PrettyCode.Print from vbcity.com, <A target="_blank" HREF=http://www.vbcity.com/page.asp?p=pcp_index>http://www.vbcity.com/page.asp?p=pcp_index</A>

    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
    <font face="Comic Sans MS">Morgan Erickson</font face=comic>
    morgan.erickson@sprint.com
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18>-From <img src=/S/flags/Colorado.gif border=0 alt=Colorado width=30 height=18> but living in <img src=/S/flags/Missouri.gif border=0 alt=Missouri width=30 height=18>...and working in Kansas.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •