Solved

Asp.Net Save as Word Doc with Pictures

Posted on 2014-12-01
2
186 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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now