I’m trying to create a Word document with C# in visual studio 2008, this is my code:
using Word = Microsoft.Office.Interop.Word;
Word.Application oWord = new Word.Application();
oWord.Visible = true;
Visual studio shows me the error:
Invalid token ‘=’ in class, struct, or interface member declaration
Why does this happen?
Your code must be inside a method, not in your class definition outside of the methods.