Solved

Asp.Net Save as Word Doc with Pictures

Posted on 2014-12-01
2
191 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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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