The match will take place on January 16.
Stamford, who are unbeaten from seven games in Northern Premier League South East - two leagues below Hereford - knocked out Kidderminster in the second round but were given a bye in the third round due to Macclesfield withdrawing from the competition.
The two clubs have never met before.