When he ______ the door,he found his keys were nowhere.
 
【正确答案】 D
【答案解析】 句意:当他要开门的时候,他发现钥匙不见了。was to do在此表示wanted to do或intended to do。would do在这里有情感意味,所以被排除。