With 途中(とちゅう) meaning ‘on the way’, the addition of either the 格助詞(かくじょし) (case-marking particle) に or で will indicate that something is either being done ‘on the way to (A)’, ‘partway through (A)’ or ‘in the middle of (A)’.
途中(とちゅう) may be seen after verbs in their standard form, or nouns followed by の.
As always, に will put more emphasis on the time or duration of (A), while で will put further emphasis on the process of (A) being the cause of (B), or being used as an opportunity to do (B). Let’s take a look at both.
-
待(ま)ち合(あ)わせ場所(ばしょ)に向(む)かっている途中(とちゅう)に、「ごめん、やっぱり今日(きょう)行(い)けないかも」と友達(ともだち)からメールが来(き)た。
On the way to the meeting place, I received a text from a friend saying, ‘Sorry, I might not be able to make it today after all’.
授業(じゅぎょう)の途中(とちゅう)に校長(こうちょう)先生(せんせい)から呼(よ)び出(だ)された時(とき)はビクッとした。
I was a bit startled when the principal called me out in the middle of class.
会社(かいしゃ)から帰(かえ)る途中(とちゅう)で変(へん)なおじさんに話(はな)しかけられた。
On my way home from work, a strange man tried to talk to me.
ミーティングの途中(とちゅう)で社長(しゃちょう)が倒(たお)れて、会社中(かいしゃじゅう)がパニックになった。
The president collapsed in the middle of a meeting and everyone in the whole company panicked.
The meanings of で and に in regard to this particular grammar point can overlap quite often, so it may be necessary to see many examples before the slight difference in nuance becomes apparent.