The 6ft 4in forward will join the Tynecastle club on January 1, 2019 in a deal that will keep him in Gorgie until May 2020.
Manager Craig Levein still hopes to bring Vanecek to Hearts this summer, the club waiting to learn if a five-figure bid for the player will be accepted by Teplice.
The 27-year-old scored ten goals for Teplice in the Czech top tier last season, and has notched a total of 19 goals in 64 games for the club.
Levein told the Hearts website: “I’m very pleased that David has agreed to join the club. He’s different from the other strikers we currently have and I’m looking forward to working with him.
“He’s a target man and is very good in the air. His hold-up play is impressive as well and he’ll be a great addition to the squad.
“As it stands, he will join us in January. If we can get him in this window then great, but regardless of what happens, the important thing is that he has fully committed himself to Hearts.”