Create Line Symbol Function


Use this function to create a simple line symbol. Line symbols are used when rendering linear features.

How to use:
  1. Call this function in VBA optionally passing in a color, style, and width. The function returns an ISimpleLineSymbol.
Private Function CreateSimpleLineSymbol(Optional yourColor, _
                                        Optional yourStyle, _
                                        Optional yourWidth) as ISimpleLineSymbol
  Dim pSLS As ISimpleLineSymbol
  Set pSLS = New SimpleLineSymbol

  If Not IsMissing(yourColor) Then
    pSLS.color = yourColor
  End If

  If Not IsMissing(yourStyle) Then = yourStyle
  End If

  If Not IsMissing(yourWidth) Then
    pSLS.width = yourWidth
  End If

  Set CreateSimpleLineSymbol = pSLS
End Function