sentence1: Only when the French succeeded in blowing up part of the garrison, during the War of the Spanish Succession in 1707, was the castle taken.
sentence2: The castle was taken when the French blew up part of the garrison during the War of the Spanish Succession in 1707.