locked
Word Document Management RRS feed

  • Question

  • User-276018626 posted

    Hi Experts,

     

    I need to write a web application that will read Microsoft Word documents stored on the server as Template.

     Those Templates documents will have some tags on them that will be substituted by values on tables in the database.

    like a letter

    Dear <Fname> <Lname>

    These tags <Fname> <Lname> will replace from database values.

    How can i do this ??

    Any idea will b Helpful.

    Thnaks in Advance.

     

     

     

    Thursday, October 28, 2010 8:51 AM

Answers

  • User197322208 posted

    Text file : a.txt

    Dear <fname> <lname>


    C# Code

    string s = File.ReadAllText("A.txt");

    s= s.Replace("<fname>","Andrei");

    s= s.Replace("<lname>","Ignat");


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 28, 2010 3:21 PM

All replies

  • User197322208 posted

    Create a document with <Fname> <Lname>

    Save as RTF.

    read the contents ( with File.ReadAllText ) and replace the <Fname>, <Lname> with values.

    Thursday, October 28, 2010 9:50 AM
  • User-276018626 posted

    Thanks for the Reply.

    can u please give me sample code.

     

    Thanks in Advance. 

    Thursday, October 28, 2010 10:14 AM
  • User197322208 posted

    Text file : a.txt

    Dear <fname> <lname>


    C# Code

    string s = File.ReadAllText("A.txt");

    s= s.Replace("<fname>","Andrei");

    s= s.Replace("<lname>","Ignat");


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 28, 2010 3:21 PM