Meaning of "by the way"

Dear teachers,

Please tell me the meaning of “by the way” in:
a.Oh, by the way, there is a telephone message for you.
b.Stop for a picnic by the way.

“By the way” in(a) and (b) have the same meaning?

Hi Quoc,

In (a) by the way suggests incidentally. By the way in (b) doesn’t work for me. I would say on the way suggesting during the course of the trip/journey.

Hi Quoc

Is “Stop for a picnic by the way” a sentence that your teacher dreamed up or did you dream it up yourself? 8)
I agree with Alan — this sentence sounds odd.

In addition to Alan’s suggestion, you could also say “We stopped for a picnic along the way”.