Bill,
Crystal Long (strive4peace) has an
Access Addin to color vba code and output to HTML. It is not a COM addin, but may be useful depending on your detailed needs.
A Sample:
<pre><span style="color:green">'---------------------------------------------------------------------------------------
' Procedure : GetProgramFilesFolder
' Author : Bill Mosca
' Date : 21-10-2011
' Purpose :an easy way to get the Program Files folder path on your PC
'---------------------------------------------------------------------------------------
' Last Modified:
'
' Inputs: N/A
' Dependency: N/A
'--------------------------------------------------------------------------
'</span>
<span style="color:blue">Public Function</span> GetProgramFilesFolder() <span style="color:blue">As String</span>
<span style="color:blue">Const</span> PROGRAM_FILES = &H26&
<span style="color:blue">Dim</span> objShell <span style="color:blue">As Object</span>
<span style="color:blue">Dim</span> objFolder <span style="color:blue">As Object</span>
<span style="color:blue">Dim</span> objFolderItem <span style="color:blue">As Object</span>
10 <span style="color:blue">On Error GoTo</span> GetProgramFilesFolder_Error
20 <span style="color:blue">Set</span> objShell = CreateObject( "Shell.Application")
30 <span style="color:blue">Set</span> objFolder = objShell.Namespace(PROGRAM_FILES)
40 <span style="color:blue">Set</span> objFolderItem = objFolder.self
50 <span style="color:blue">Debug.Print</span> objFolderItem.Path
60 <span style="color:blue">On Error GoTo</span> 0
70 <span style="color:blue">Exit Function</span>
GetProgramFilesFolder_Error:
80 MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure GetProgramFilesFolder of Module AWF_Related"
<span style="color:blue">End Function</span> </pre>
' Made with Color Code add-in posted on
Color Code