Click here to Skip to main content
13,048,846 members (78,451 online)
Rate this:
Please Sign up or sign in to vote.
See more:
 if (DropDownListDownloadCv0.Text == "DOC")
                        string sDirPath = Server.MapPath("~/PDF_WORD/Docs");
                        var ObjSearchDir = new DirectoryInfo(sDirPath);
                        if (!ObjSearchDir.Exists)
                        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);
Posted 23-Apr-13 22:45pm
ThePhantomUpvoter 24-Apr-13 7:11am
"Where should i put objfileinfo?", where ever you want. You likely do not need it at all for whatever it is that you are trying to do.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 24 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100