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

  • Home
  • SEARCH
  • 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 103469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:07:44+00:00 2026-05-11T01:07:44+00:00

I have a quite common problem, as I saw in the various user groups

  • 0

I have a quite common problem, as I saw in the various user groups but could not find a suitable answer.

What I want to do is generate an ASP.NET page in my website which will have the option of being exported into Microsoft Word .doc format.

The method I have used is this:

Response.Clear(); Response.AddHeader('content-disposition', 'attachment;filename=Test.doc'); Response.Charset = ''; Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ContentType = 'application/msword';  StringWriter sw = new StringWriter(); HtmlTextWriter htmlWrite = new HtmlTextWriter(sw); Page.RenderControl(htmlWrite); Response.Write(sw.ToString()); Response.End(); 

However this eventhough it generates a word doc, the images are note embedded in the document, rather they are placed as links. I have looked for a way to do this, but have not found something that actually worked.

I would appreciate any help I can get, since this as ‘last minute’ requirement (talk about typical)

Thanks

  • 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. 2026-05-11T01:07:44+00:00Added an answer on May 11, 2026 at 1:07 am

    Short Answer: You need to provide absolute URLs for the source of the images in your page.

    Longer Answer:

    Microsoft Word will open an HTML document if you rename it with a *.doc extension. This is what the code that you provided is doing. In this case, the images are not embedded in the document like they would be if you created a document in actual Word format. If your images are using relative URLs then Word will not know where to look for them, hence the need for absolute URLs.

    NOTE: This means that anyone viewing the document without an internet connection will not see the images, as they are requested from the server every time the document is opened.

    A more elegant solution would be to create the document in the real Word format. A great library for this is Aspose.Words. Using this library you would be able to embed the images directly into the document so that they do not rely on the server.

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

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer What that message is telling you is that your JRE… May 11, 2026 at 3:57 pm
  • added an answer If you start a new project, then ASP.net MVC is… May 11, 2026 at 3:57 pm
  • added an answer I don't know if there is any built in functionality… May 11, 2026 at 3:57 pm

Related Questions

I have an application that supplies long list of parameters to a web page,
I've been evaluating various smart pointer implementations (wow, there are a LOT out there)
This must be a common problem because I see it in many published papers
We have a Java Applet built using AWT. This applet lets you select pictures

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.