PDA

View Full Version : Solved: Print out macro code



koala
11-07-2005, 05:32 AM
Hi Forum,

I am not sure if this is the right forum for this question.

Can anyone tell me how to print out my code from the VB Editor and maintain the colors that VB uses eg. green for comments.

My code always prints out in black even though I have a colour printer and it is set to colour.

If this is the wrong forum, where can I get advise for this problem?

Hoping someone can assist
Koala

samuelwright
11-07-2005, 09:20 AM
Hi Koala

Perhaps this won't be the best answer, but if I have had to print out VBA before, I have just copied and pasted it into Word (or whatever word processor you use): that way the colours remain

However, sometimes Word messes up the tabulation, especially if your lines are long. Therefore some painstaking work is required to tidy it up, especially if it is a long macro.

Sorry I couldn't offer more sophisticated help!

Sam

TonyJollans
11-07-2005, 11:24 AM
Hi koala,

There is no builtin capacity for this but there are freeware programs out there which do it (one called PrettyCodePrint, I think, but there are others); most are for VB but also work with VBA. Your best bet is to Google.

Bob Phillips
11-07-2005, 12:18 PM
Hi koala,

There is no builtin capacity for this but there are freeware programs out there which do it (one called PrettyCodePrint, I think, but there are others); most are for VB but also work with VBA. Your best bet is to Google.

PrettyCodePrint has a ConnectVBA method that allows it to become a VBA add-in, I know as I have it installed, never use it though, the colours in the VBIDE are too insipid to be of much help IMO

Zack Barresse
11-07-2005, 12:41 PM
PrettyCode is nice, I've used it. But you must purchase it after so long as it is not Share/Freeware. That was the deciding factor for me. :)

T'would be nice to do so in Word. :)

Ken Puls
11-07-2005, 04:03 PM
Perhaps this won't be the best answer, but if I have had to print out VBA before, I have just copied and pasted it into Word (or whatever word processor you use): that way the colours remain

Colours are all lost doing this for me.

Can't say I've ever tried prettycode, either. I use the convoluted route of the VBEHTMLMaker (found here (http://www.mrexcel.com/vbaddin.shtml)), dump it in Notepad, save it as a .html file, and print it from there.

Kind of a pain, but it does work.

Bob Phillips
11-07-2005, 05:26 PM
PrettyCode is nice, I've used it. But you must purchase it after so long as it is not Share/Freeware. That was the deciding factor for me. :)

T'would be nice to do so in Word. :)

Disn't know that, proves I don't use it.

koala
11-08-2005, 01:43 AM
Thanks for all your replies, I guess I will just have to do it the only way I know, which is copying it to word then going through and changing the font colour where applicable. Not a very easy way, but it does work. Its just that I find it is much easier to read and debug on paper than on a screen.

Koala

Bob Phillips
11-08-2005, 01:59 AM
Thanks for all your replies, I guess I will just have to do it the only way I know, which is copying it to word then going through and changing the font colour where applicable. Not a very easy way, but it does work. Its just that I find it is much easier to read and debug on paper than on a screen.

Koala

Did you not see Ken's reply? No simple, but easier5 than your method it seems to me.

Emily
11-08-2005, 02:17 AM
I found VB Source To HTML ActiveX Dll in the net but don't know how to use it.

Please try and give me some information

Thanks

http://hjem.get2net.dk/GeWare/VB2HTML.htm

koala
11-08-2005, 05:23 AM
Thanks everyone,

I tried VBEHTMLMaker, but all i get is a heap of goobleygook in notepad. I also tried the download Emily suggested, but am lost getting it to work.

Never mind, I shall just keep going the way I have been.

Thanks for trying

cheers
Koala

CCkfm2000
11-08-2005, 05:33 AM
hi koala,

check out this link http://ccgi.zilpher.plus.com/zilpher/colourcode.php

you have to copy your code and paste it in the box.
have not used it myself yet.

have fun

cckfm2000

koala
11-08-2005, 06:21 AM
Thanks cckfm2000,

That works a treat

It was just a matter of placing my code in the box, hitting the go button and it did the rest.

This maybe what you were after as well Emily

cheers
Koala

CCkfm2000
11-08-2005, 06:29 AM
no problem....

cckfm2000

Zack Barresse
11-08-2005, 10:37 AM
You know that zHTML came from one of our own members, right?

Zilpher .. http://www.vbaexpress.com/forum/member.php?u=957

:D

Ken Puls
11-08-2005, 01:06 PM
Thanks everyone,

I tried VBEHTMLMaker, but all i get is a heap of goobleygook in notepad. I also tried the download Emily suggested, but am lost getting it to work.

Never mind, I shall just keep going the way I have been.

Thanks for trying

cheers
Koala

Hi Koala,

Late back to this, and I'm glad you got a solution. For reference, that goobleygook should be the HTML source code. It's not supposed to make sense in that form (unless you know how to read it). The imporant part is that you save it with an HTML or HTM extension, and then open it in your web browser. That will show you what you were after. :)