For Programmers: Free Programming Magazines  


Home > Archive > ASP > September 2004 > Response.Content Type with word document problem.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Response.Content Type with word document problem.
Joan

2004-09-22, 3:55 pm

I am creating a word document from an asp page. I have no problems
actaully creating the document and creating some tables that have data
in them. I am using Response.ContentType = "application/vnd.ms-word"
to create the actual document. My problem is that I want to place a
picture (which resides on the server) into the word document as well.
However all I seem to get is the place for the image but a picture of
an "x" meaning that the picture is missing.
Any suggestions?????
Anthony Marchesini

2004-09-22, 8:55 pm

Try using fully qualified URLs for the pictures. In other words, make sure
the reference to the picture includes 'http://www.yoursite.com' at the
start.

Anthony Marchesini


"Joan" <jojo1098@hotmail.com> wrote in message
news:748ac99f.0409220928.759d05db@posting.google.com...
> I am creating a word document from an asp page. I have no problems
> actaully creating the document and creating some tables that have data
> in them. I am using Response.ContentType = "application/vnd.ms-word"
> to create the actual document. My problem is that I want to place a
> picture (which resides on the server) into the word document as well.
> However all I seem to get is the place for the image but a picture of
> an "x" meaning that the picture is missing.
> Any suggestions?????



Joan

2004-09-23, 3:55 pm

Thanks but that didn't work either. I'm using the html to place the
picture in the word document. Something like this: <img alt
src="http://mysite.com/Pics/mypic.jpg>. Is this the problem or do I
need to use Response.Write?

Anybody please help asap. I'm desperate.

"Anthony Marchesini" <Arm07470@newsgroup.nospam> wrote in message news:<uKRxabOoEHA.3324@TK2MSFTNGP10.phx.gbl>...[color=darkred]
> Try using fully qualified URLs for the pictures. In other words, make sure
> the reference to the picture includes 'http://www.yoursite.com' at the
> start.
>
> Anthony Marchesini
>
>
> "Joan" <jojo1098@hotmail.com> wrote in message
> news:748ac99f.0409220928.759d05db@posting.google.com...
Anthony Marchesini

2004-09-24, 3:55 am

Try saving the file your asp code is sending. Take a look at it in a text
editor (not word) and make sure everything looks right. Rename the file
from *.doc to *.htm and view it in your browser. If the pictures don't show
up there then there's still something wrong with the html your asp page is
writing. If they *do* show in the browser but *not* in Word, then you'd be
dealing with a Word issue and you'll probably have to ask your question in
another forum.

Good luck!

- Anthony

"Joan" <jojo1098@hotmail.com> wrote in message
news:748ac99f.0409231117.5b0e9c61@posting.google.com...
> Thanks but that didn't work either. I'm using the html to place the
> picture in the word document. Something like this: <img alt
> src="http://mysite.com/Pics/mypic.jpg>. Is this the problem or do I
> need to use Response.Write?
>
> Anybody please help asap. I'm desperate.
>
> "Anthony Marchesini" <Arm07470@newsgroup.nospam> wrote in message

news:<uKRxabOoEHA.3324@TK2MSFTNGP10.phx.gbl>...[color=darkred]
sure[color=darkred]


Joan

2004-09-24, 3:55 pm

Thanks for your help. The pictures do show in the browser. I don't
think its a problem with the html the asp page is writing because then
the picture shouldn't have shown up in the browser. I think the
problem has something to do with just trying to display an image in a
word document that was created through an asp page. The problem is
definitely with asp - maybe something with the Response.ContentType
but I'm not sure so I really don't know where else I would ask this
question. Thanks for your help though, hopefully something will turn
up. Anybody, any other suggestions.

"Anthony Marchesini" <Arm07470@newsgroup.nospam> wrote in message news:<ObTDo#foEHA.2304@TK2MSFTNGP14.phx.gbl>...[color=darkred]
> Try saving the file your asp code is sending. Take a look at it in a text
> editor (not word) and make sure everything looks right. Rename the file
> from *.doc to *.htm and view it in your browser. If the pictures don't show
> up there then there's still something wrong with the html your asp page is
> writing. If they *do* show in the browser but *not* in Word, then you'd be
> dealing with a Word issue and you'll probably have to ask your question in
> another forum.
>
> Good luck!
>
> - Anthony
>
> "Joan" <jojo1098@hotmail.com> wrote in message
> news:748ac99f.0409231117.5b0e9c61@posting.google.com...
> news:<uKRxabOoEHA.3324@TK2MSFTNGP10.phx.gbl>...
> sure
Bob Barrows [MVP]

2004-09-24, 3:55 pm

Create a Word document displaying the image, save it as HTML and see if
there's a difference.

Bob Barrows
Joan wrote:[color=darkred]
> Thanks for your help. The pictures do show in the browser. I don't
> think its a problem with the html the asp page is writing because then
> the picture shouldn't have shown up in the browser. I think the
> problem has something to do with just trying to display an image in a
> word document that was created through an asp page. The problem is
> definitely with asp - maybe something with the Response.ContentType
> but I'm not sure so I really don't know where else I would ask this
> question. Thanks for your help though, hopefully something will turn
> up. Anybody, any other suggestions.
>
> "Anthony Marchesini" <Arm07470@newsgroup.nospam> wrote in message
> news:<ObTDo#foEHA.2304@TK2MSFTNGP14.phx.gbl>...

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com