HTML editor to Format VBA Code

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 15:16
Joined
Jul 9, 2003
Messages
17,347
I want to post code on my website.

I would like it to be formated the same on the web page as it is in the MS Access code module.

For Example:

Code:
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.

    ' Move to the switchboard page that is marked as the default.
    Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
    Me.FilterOn = True
    
End Sub     'Form_Open

Private Sub Form_Current()
' Update the caption and fill in the list of options.

    Me.Caption = Nz(Me![ItemText], "")
    Me.lblPageTitle.Caption = Nz(Me![ItemText], "")
    FillOptions
    
End Sub      'Form_Current

Is there a free online HTML code editor that will do this?
 
Don't understand your question: the ones I've seen all leave a formatted text alone, if displayed in a block quote or something. Try TinyMCE.
attachment.php


attachment.php
 

Attachments

  • TinyMCE.PNG
    TinyMCE.PNG
    65.2 KB · Views: 863
I still don't get it. I showed you one example above. Now I pasted code copied from Access VBA into the TimyMCE demo and it retained the formatting - did you try it?

attachment.php
 

Attachments

  • Tiny2.PNG
    Tiny2.PNG
    25.9 KB · Views: 807
There is an old Add-in from Bykin, Converting VBA code into HTML Version 1.40, that I use that quickly and easily saves code into an html file. The resulting code looks very good but the HTML is old style and is not easy to read. Lately I use the Add-in to create the file and then modify it so that the HTML is much cleaner.

One of the ways I clean up the HTML is by using the <pre> tag for code:
<pre>My Code Here</pre>. The <pre> tag preserves spaces and end of lines so you do not need to use &nbsp for spaces and <br /> to end a line. This allows me to use a text file manager to replace   and <br /> tags.

You can download the addin from the excellent MS Access Professionals Group on Yahoo but you must join the group. The file is named Vba2html.zip and can be downloaded from the Files > 0_Utilities and Add-ins folder.

I have not tried this but there is an add-in here that sounds good. www dot mrexcel.com/vbaddin dot shtml
 
Thanks Pat, I will look in to it when I get back from hols...
 

Users who are viewing this thread

Back
Top Bottom