Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3784702
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:25:01+00:00 2026-05-19T11:25:01+00:00

I have several form letters in Word 2007 templates. I need to pass data

  • 0

I have several form letters in Word 2007 templates. I need to pass data from my web forms application(Sql Server 2008 backend).

I need to do this as seamlessly as possible so generating a text file for word to use as a datasource is not an option. I also want to avoid running Office on my web server for performance reasons.

I am wondering if there is a way to store the template xml in my database and populate the proper elements with my data when the letters need to be generated, and having this file downloaded directly to the users machine.

Does anyone have a solution for this type of issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:25:02+00:00Added an answer on May 19, 2026 at 11:25 am

    If you create a Word 2007 .docx file with tokens that you want to replace you can then easily replace the tokens on a server and send the client a new .docx file based on the old one with replaced tokens.

    1. Create your template as a .docx file and save it on the server
    2. Change all your mail-merge fields with easy to find and parse placeholders that are not going to appear int he document normally and will not require XML encoding. For example: {{FirstName}}.
    3. Create a new blank .docx (zip) file for each document you want to generate
    4. Read each file from inside the template .docx file
    5. As you read the source file, search for and replace your tokens as appropriate
    6. Be sure the XML Encode all text you put in the new document. You can either use HttpUtility.HtmlEncode, an XmlTextWriter instance, or a custom method to replace the offending characters (<, ‘, “, >) with corresponding xml entities.
    7. Send file to client

    More complicated things could be done by manipulating the WordML tags but if you just want to replace some variable data, the above would be easiest/fasted method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

trying to develop web form using jquery. all i need is to have several
I have several DropDown controls on a Web Form which are filled using AJAX
I have several Infopath form templates on my sharepoint site. Normally, I have to
I have several forms(user can add new form dynamically) in one page, they're all
I have several forms each having a hidden field that identifies this form...I want
I have several forms inside DIVS on my page. I have one form which
I have several transactions to insert form data into oracle table. if (InsertQuarterly() ==
I have several forms (Oracle database and form 10) which have not been developed
I'm creating a login form that's loaded from a nib. I have several NSTextFields,
I have several forms in my application, and like all forms after the users

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.