I need your help. Please help me.
I am using C#NET2008 to develop Window Application to fill Microsoft WORD 2003 Template textbox with data from FORM textbox control input my user then print save and print the WORD Template as Letter to the customer.
Apparently it is now working as I have not done it before
This is the error message
Error 1 The best overloaded method match for 'Word.FormFields.this[ref object]' has some invalid arguments
This are the codings that generated it:
oDoc.FormFields["dtxtDatePrint"].Range.Text = DateTime.Now.ToShortDateString;
oDoc.FormFields["dtxtCompName"]).Range.Text = strCustArray[0];
Expand|Select|Wrap|Line Numbers
- if (DR.HasRows== true )
- {
- object objFileName = strFileNamePath; // F:\\SaleDepart\\Custfolder\OrderLetter.dot
- object objReadOnly = false;
- object objIsVisible = true;
- object oMissing = System.Reflection.Missing.Value;
- Word.Application oWord = new Word.Application();
- Word.Document oDoc = new Word.Document();
- Word.Table oTable;
- oWord.Visible = true;
- oDoc = oWord.Documents.Add(ref objFileName, ref oMissing, ref oMissing, ref oMissing);
- // template control : dtxtDatePrint, dtxtCompName
- oDoc.Activate();
- Doc.FormFields["dtxtDatePrint"].Range.Text = DateTime.Now.ToShortDateString;
- oDoc.FormFields["dtxtCompName"]).Range.Text = strCustArray[0];
- }