Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Word
 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);
Posted 23-Apr-13 23:45pm
Kurac1632
Comments
ThePhantomUpvoter at 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
0 Sergey Alexandrovich Kryukov 520
1 Mathew Soji 335
2 BillWoodruff 260
3 OriginalGriff 215
4 Afzaal Ahmad Zeeshan 188
0 OriginalGriff 6,168
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,028
3 Manas Bhardwaj 4,539
4 Maciej Los 3,845


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 24 Apr 2013
Copyright © CodeProject, 1999-2014
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