Microsoft Word doesn't have any such feature. There is a grammar
checker, which presumably has some internal parsing algorithm that
tries to identify the parts of speech, but (a) its results aren't
available outside the grammar checker and (b) its accuracy is only
fair (as is true of all current algorithms for processing
unconstrained natural language).