Hi,
I`m struggling to make this work, but till now i didn't found any answers on the web. Here is my problem, i have a doc file created on office 2003 and i have a table in it ( header and a first empty row ). How can i select that table from C# and add a new row in it? [ I populate the table from a listview ].
Please help me.
Regards.
P.S.
Here is my code:
Word.ApplicationClass myWordApp = new Word.ApplicationClass();
Word.Document myWordDoc = new Word.Document();
object nothing = System.Reflection.Missing.Value;
object filename = @"D:\LeadTemplate.doc";
object notTrue = false;
myWordApp.Visible = false;
myWordDoc = myWordApp.Documents.Add(ref filename, ref nothing, ref nothing, ref nothing);
object oBookmark = "CNameBookMark";
myWordDoc.Bookmarks.get_Item(ref oBookmark).Range.Text = comboBox1.Text.ToString();
DateTime dtToday = DateTime.Now;
string dateN = dtToday.ToString("dd/MM/yyyy", CultureInfo.CreateSpecificCulture("en-US"));
object dBookmark = "CurrentDateBookmark";
myWordDoc.Bookmarks.get_Item(ref dBookmark).Range.Text = dateN.ToString();
object dest = @"D:\qfspinv"+InvoiceNumber+" Lead Statement "+comboBox1.Text.ToString()+".doc";
myWordDoc.SaveAs(ref dest, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing);
myWordApp.Application.Quit(ref notTrue, ref nothing, ref nothing);