she wasn’t speaker until 2007.
She was elected as their candidate by the Democratic Caucus on November 16 of 2006, and formally elected by the House on January 3 of 2007.