XML Comments (1 Viewer)

RonPaii

Active member
Local time
Yesterday, 21:30
Joined
Jul 16, 2025
Messages
236
I have been adding XML style comments to my procedure headers for a more structured comment system. It would be great if MS could enhance VBA, to use them in intellisence like in .NET.

Code:
''' <summary>
''' Check if user is member of an Active Directory group
''' </summary>
''' <param name="AdGroupName">Name of AD group to check.</param>
''' <param name="UserWinID">User ID to check, Current if empty.</param>
''' <param name="oUseConnection">Existing connection, else use new.</param>
''' <returns>True if user in group and no error.</returns>
Public Function ADGroupMember( _
                ByVal AdGroupName As String, _
                Optional ByVal UserWinID As String = vbNullString, _
                Optional oUseConnection As ADODB.Connection = Nothing) As Boolean
 
MzTools has a pretty nice one; fully configurable. Best 100 bucks I ever spent.

Code:
' ----------------------------------------------------------------
' Procedure Name: $P[CODE_ELEMENT_NAME]
' Purpose: $U[Procedure Purpose]
' Procedure Kind: $P[CODE_ELEMENT_KIND_DESCRIPTION]
' Procedure Access: $P[CODE_ELEMENT_ACCESS_KEYWORD]
$P[PARAMETER_SECTION_BEGIN]' Parameter $P[PARAMETER_NAME] ($P[PARAMETER_TYPE_NAME]): $U[Parameter purpose]
$P[PARAMETER_SECTION_END]$P[METHOD_RETURN_SECTION_BEGIN]' Return Type: $P[METHOD_RETURN_TYPE_NAME]
$P[METHOD_RETURN_SECTION_END]' Author: $P[AUTHOR]
' Date: $P[DATE]
' ----------------------------------------------------------------
 
MZ-Tools is a great tool for MS Access development. I use the function header feature frequently. It could be customized easily to format the header in xml format. I understand the OP is also referring to how Visual Studio DotNet then uses the xml header when calling the function to show intellisense popups with the description of the function and parameters (like in the screenshot below). That would be useful if the VBA Editor had something like that. Unfortunately, it's probably unlikely MS will put any resources to adding it.

xml-Intellisense-DotNet.png
 

Users who are viewing this thread

Back
Top Bottom