Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Asp.Net Save as Word Doc with Pictures

Posted on 2014-12-01
2
Medium Priority
?
206 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 1500 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 2

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

916 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