Error:System.NullReferenceException: 'Object reference not set to an instance of an object.'
Codigo
if (dataGridView1.Rows.Count > 0)
{
object objMiss = System.Reflection.Missing.Value;
Word.Application ObjWord = new Word.Application();
string ruta = Application.StartupPath +
C:\Users\Jonathan\Documents\Proyectos Jonathan\Inventario\Inventario\Reglamento.docx";
object parametro = ruta;
object objEndOfDocFlag = "Equipos";
Word.Document Objdoc = ObjWord.Documents.Open(parametro, objMiss);
Word.Range objWordRng = Objdoc.Bookmarks.get_Item(ref objEndOfDocFlag).Range;
int NumCols = 10;
Word.Table objTab1 = Objdoc.Tables.Add(objWordRng, dataGridView1.Rows.Count, NumCols, ref objMiss, ref objMiss);
objTab1.Range.ParagraphFormat.SpaceAfter = 6;
int iRow, iCols;
for (iRow = 1; iRow <= dataGridView1.Rows.Count; iRow++)
{
for (iCols = 1; iCols <= NumCols; iCols++)
{
objTab1.Cell(iRow, iCols).Range.Text = dataGridView1.Rows[iRow].Cells[iCols].ToString(); //add some text to cell
}
}
}