network-algorithms

How do you find the closest point to line on a geometric network in VBA?

I work in GIS with VBA. I have a geometric network that contains 2 layer River (polyline) and Hydrometry station (Point). I want to find the closest Point to the selected River, but I want that distance to be measured on the network, not the direct distance. How can I code this in VBA? ...