Create Marker Symbol Function


Use this function to create a simple marker symbol. Marker symbols are used when rendering point features.

How to use:
  1. Call this function in VBA optionally passing in color, angle, size, style, xoffset and yoffset. The function returns an ISimpleMarkerSymbol.
Private Function CreateSimpleMarkerSymbol(Optional pColor, _
                                          Optional pAngle, _
                                          Optional pSize, _
                                          Optional pStyle, _
                                          Optional pXoffset, _
                                          Optional pYOffset) as ISimpleMarkerSymbol
  Dim pSMS As ISimpleMarkerSymbol
  Set pSMS = New SimpleMarkerSymbol
  If Not IsMissing(pAngle) Then
    pSMS.Angle = pAngle
  End If
  If Not IsMissing(pColor) Then
    pSMS.Color = pColor
  End If
  If Not IsMissing(pSize) Then
    pSMS.Size = pSize
  End If
  If Not IsMissing(pStyle) Then
    pSMS.Style = pStyle
  End If
  If Not IsMissing(pXoffset) Then
    pSMS.XOffset = pXoffset
  End If
  If Not IsMissing(pYOffset) Then
    pSMS.YOffset = pYOffset
  End If
  Set CreateSimpleMarkerSymbol = pSMS
End Function