I think you are getting this error because you have not referenced any "Microsoft Word Object library".
This will automatically add VBIDE, Microsoft.Office.Core along with Microsoft.Office.Interop.Word as references.
After that, you need to use the required namespace like
using Word = Microsoft.Office.Interop.Word;
For more reference, go through the below link:
Edit Microsoft Word Document From Your Application[
^]
This may help you.