Solved

Asp.Net Save as Word Doc with Pictures

Posted on 2014-12-01
2
193 Views
Last Modified: 2014-12-05
Hello,
I have a page that is being saved as a .docx file.  Works good.  Problem is it has a company logo in it that isn't coming thru to the word file.  I can see the logo in my browser.

On the .aspx page I have
<%Response.AddHeader("Content-Disposition", "Attachment;Filename=" & thisFileNumber & "_Universal_Single.doc")
  Response.ContentType = "application/vnd.ms-word"%>

Works Great.  On the same page I have
<table width="653" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="497" valign="top"><table width="653" border="0">
      <tr>
        <td width="216"><font size="2" face="Tahoma, Arial, verdana">
            <asp:Image ID="Image2" runat="server" ImageUrl="http://Intranet/Images/Logo.jpg" width="216" height="72" />
            </font></td>
        <td width="214"><div align="center" class="title2"></div></td>
        <td width="209">&nbsp;</td>
      </tr>
 </table>

Of course if I comment out the Response.ContentType and view in the browser works great.  When I un-comment Response.ContentType - no logo shows up.

Any ideas?

JS
0
Comment
Question by:jshesek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
Ashutosh Vyas earned 500 total points
ID: 40475300
It won't come up straight forward.
You would have to code it for that.

Check this
http://forums.asp.net/t/1738246.aspx?How+to+save+aspx+page+to+doc+or+docx+file+



Thanks
Ashutosh
0
 
LVL 1

Author Closing Comment

by:jshesek
ID: 40483792
Good references.  Eventually I figured out I was trying to pull the image from an area where Active directory is used.  When switched to general area the images displayed.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question