if (DropDownListDownloadCv0.Text == "DOC") { string sDirPath = Server.MapPath("~/PDF_WORD/Docs"); var ObjSearchDir = new DirectoryInfo(sDirPath); if (!ObjSearchDir.Exists) { ObjSearchDir.Create(); } string strFileName = HttpContext.Current.Server.MapPath("~/PDF_WORD/Docs/Cv." + "DOC" + ""); var objfileinfo = new FileInfo(strFileName); // step 1: creation of a document-object Microsoft.Office.Interop.Word._Application w = new Microsoft.Office.Interop.Word.Application(); //var document = new Microsoft.Office.Interop.Word.Document(); object missing = System.Reflection.Missing.Value; w.Visible = true; _Document doc = w.Documents.Add(ref missing, ref missing, ref missing, ref missing); Paragraph para1 = doc.Content.Paragraphs.Add(ref missing); para1.Range.Text = LabelFirstName.Text; } } } Where should i put objfileinfo? var objfileinfo = new FileInfo(strFileName);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)