Create a function in itself.
code:
Public Function ChangeDisplayPicture(ByVal sPath As String) As Boolean
On Error GoTo mError
objMessengerAPI.MyProperty(M_ContactProperty_DP) = sPath
ChangeDisplayPicture = True
Exit Function
mError:
ChangeDisplayPicture = False
End Function
Then you can call it like ChangeDisplayPicture "<path>"