I used the word "whomever" in the following sentence, but MS Word grammar checker told me to change it to "whoever." "She wanted to stay in contact with whomever was on the other end of the line." I thought it should be "whomever" since the preceding word is a preposition - as in" with whom were you speaking or to whom it may concern. Which is correct?
I'd say "whomever" is correct. I heard once that to figure out whether to use "whom" or "who", simply see if you can substitute the word with "him" or "he". I could be wrong ok, so take it with a pinch of salt! eg. Who is this? He is Tom. eg. Whom does this belong to? This belongs to him. Thus, for your example: "She wanted to stay in contact with whomever was on the other end of the line," since "whomever", in a different construction, could be substituted with "him", "her" or "them", I'd say "whomever" is correct. But "whoever" is how most people actually speak. Since yours is in narrative, I think "whomever" is fine.
Agreed Who is for the subject of sentence. Who went to town? Jill went to town. Whom is for the object of the sentence. Jill spoke to whom? Jill spoke to Jack.