The sentence in which the word <em>but </em>is used as a preposition is the last one - D. We discovered that Candy will do anything but work.
Here, the word <em>but </em>can be replaced with another preposition - except.
In all of the other sentences, but is used as a conjunction.
C. to capitalise the words Thursday, Kevin and Jack.
<span>These nonessential elements, which can be words, phrases, or clauses, are set off with commas. Rule: Use commas before and after nonessential words, phrases, and clauses, that is, elements embedded in the sentence that interrupt it without changing the essential meaning.</span>