Translate into English. Use the full form of the verbs.
Когда я вошел в кабинет, он как раз подписывал документы.