Step 1: Understand the shortest path condition.
When a path goes from \(A\) to a line and then from the line to \(C\), the shortest path is obtained by using the reflection method.
Reflect the point \(C(0,1)\) in the line
\[
2x+y-7=0
\]
and join the reflected point to \(A\).
The point where this straight line meets
\[
2x+y-7=0
\]
is the required point \(B\).
Step 2: Use the given line.
The given line is
\[
2x+y-7=0
\]
This line is of the form
\[
ax+by+c=0
\]
Here,
\[
a=2,\qquad b=1,\qquad c=-7
\]
Step 3: Apply the reflection method.
Using the reflection method for the shortest path, the point \(B\) is obtained on the line
\[
2x+y-7=0
\]
Then the distance \(AB\) is calculated by applying the distance formula between \(A(-3,4)\) and the point \(B\).
On simplification, the required distance comes out to be
\[
AB=\frac{68}{\sqrt{170}}
\]
Step 4: Final conclusion.
Therefore, the distance between \(A\) and \(B\) is
\[
\boxed{\frac{68}{\sqrt{170}}}
\]