As the error message is telling you, you are not allowed to compare Unassigned
against a COM object in the context of an OleVariant
. That's an illegal comparison.
Your test should instead use VarIsEmpty
:
if VarIsEmpty(FWordApp) then
FWordApp := CreateOleObject('Word.Application');