Your copyeditor or line editor uses the Chicago Manual of Style. But knowing these style and grammar conventions yourself helps your book, too. A manuscript that arrives on my desk with clear writing gets lifted even higher. For example, there's the use of a single-word utterance. How do you handle something like, "Where?"
CMOS says the utterance can usually be introduced without the help of a comma — and without quotation marks or an initial capital:
She looked up and said hi.
We told her no.
Don’t ask me why.
Eventually, though, in a novel or story, your dialogue needs to sound natural and dramatic. Sentence fragments, the kind that Word warns you about, make for the natural flow and include one-word lines. It's called direct discourse. CMOS says one-word dialogue utterances are usually placed in quotation marks and set off by a comma, like any other quoted words of dialogue:
She looked up and said, “Hi.”
“Hi,” I replied, a little embarrassed by the echo.
This style suggests that the word or words in quotation marks were literally spoken as written. But it can be awkward to put the speaker ahead of the quotation. To smooth things out, try reversing the order:
“Hi,” she said, looking up.
Learn more at “Is a Comma Needed to Introduce Dialogue?” You might leave such stuff to your editor, but they'll help you in extra ways if the writing already uses dialogue well.