Access/VBA Library

Tag

Puts a string between an opening and closing tag and returns the result as a String..

Syntax

Tag( name, Content [, className] )
Parameters
Name Type Description
name String Required. Name of the tag i.e. "div", "p"....
Content String Required. Content of the tag.
className String Optional. Namelist of the CSS-classes to be included.
Default: ""
Return value

String

Code
Public Function Tag(name As String, _
                    Content As String, _
                    Optional ByVal className As String = "") _
                    As String
    Dim result As String
    
    Concat result, "<", name
    If className <> "" Then
        Concat result, " class=", Chr(34), className, Chr(34)
    End If
    
    Concat result, ">", Content, "<", "/", name, ">"
    Tag = result
End Function

HTMLtag:HTML

See also

  • Concat