Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

htlm page to.... doc or txt file

Can anyone help me - is the following idea do-able?

I have been asked to insert a button onto our company website that allows
the user to click a button and the current record from an asp page will be
saved into a usable text file or word document.

All they are after is the text - no html codes. Imagine the screen u are
view inserted into such a file.

Is that possible? does anyone have any suggestions or places i can look for
utilities do do such a task?

Your comments will be much appreciated - even if I have to go back to them
and say its impossible because of reasons a,b,c...

Many thanks in advance
[673 byte] By [Smart] at [2007-11-9 17:46:24]
# 1 Re: htlm page to.... doc or txt file
Thanks Kris thats great!

Is there some similar contenttype for a text file?

"Kris Eiben" <eibenkthisisforspammers@yahoo.com> wrote:
>Try adding these to the top of the ASP page that displays the current
>record on-screen:
><%
>Response.ContentType ="Application/vnd.ms-word"
>Response.AddHeader "Content-Disposition","inline;filename=myWord.doc"
>%>
>The page will open in Word, pretty much as if you opened the same page
>in the browser (you may have to play with the formatting a bit).
>
>"Smart" <martinlewis@lloydjames.com> wrote in message
>news:3da2dbf6$1@10.1.10.29...
>>
>> Can anyone help me - is the following idea do-able?
>>
>> I have been asked to insert a button onto our company website that
>allows
>> the user to click a button and the current record from an asp page
>will be
>> saved into a usable text file or word document.
>>
>> All they are after is the text - no html codes. Imagine the screen u
>are
>> view inserted into such a file.
>>
>> Is that possible? does anyone have any suggestions or places i can
>look for
>> utilities do do such a task?
>>
>> Your comments will be much appreciated - even if I have to go back to
>them
>> and say its impossible because of reasons a,b,c...
>>
>> Many thanks in advance
>
>
Smart at 2007-11-11 23:18:05 >
# 2 Re: htlm page to.... doc or txt file
Try adding these to the top of the ASP page that displays the current
record on-screen:
<%
Response.ContentType ="Application/vnd.ms-word"
Response.AddHeader "Content-Disposition","inline;filename=myWord.doc"
%>
The page will open in Word, pretty much as if you opened the same page
in the browser (you may have to play with the formatting a bit).

"Smart" <martinlewis@lloydjames.com> wrote in message
news:3da2dbf6$1@10.1.10.29...
>
> Can anyone help me - is the following idea do-able?
>
> I have been asked to insert a button onto our company website that
allows
> the user to click a button and the current record from an asp page
will be
> saved into a usable text file or word document.
>
> All they are after is the text - no html codes. Imagine the screen u
are
> view inserted into such a file.
>
> Is that possible? does anyone have any suggestions or places i can
look for
> utilities do do such a task?
>
> Your comments will be much appreciated - even if I have to go back to
them
> and say its impossible because of reasons a,b,c...
>
> Many thanks in advance
Kris Eiben at 2007-11-11 23:19:11 >
# 3 Re: htlm page to.... doc or txt file
Sorry, the only ones I know about are the Microsoft ones listed below.
Apparently they'll be listed somewhere in the HTML specs, so try w3c.org
for more help.

Response.ContentType ="Application/vnd.ms-word"
Response.ContentType ="Application/vnd.ms-excel"
Response.ContentType ="Application/vnd.ms-powerpoint"

"Smart" <martinlewis@lloydjames.com> wrote in message
news:3da2f01e$1@10.1.10.29...
>
> Thanks Kris thats great!
>
> Is there some similar contenttype for a text file?
>
>
>
> "Kris Eiben" <eibenkthisisforspammers@yahoo.com> wrote:
> >Try adding these to the top of the ASP page that displays the current
> >record on-screen:
> ><%
> >Response.ContentType ="Application/vnd.ms-word"
> >Response.AddHeader "Content-Disposition","inline;filename=myWord.doc"
> >%>
> >The page will open in Word, pretty much as if you opened the same
page
> >in the browser (you may have to play with the formatting a bit).
> >
> >"Smart" <martinlewis@lloydjames.com> wrote in message
> >news:3da2dbf6$1@10.1.10.29...
> >>
> >> Can anyone help me - is the following idea do-able?
> >>
> >> I have been asked to insert a button onto our company website that
> >allows
> >> the user to click a button and the current record from an asp page
> >will be
> >> saved into a usable text file or word document.
> >>
> >> All they are after is the text - no html codes. Imagine the screen
u
> >are
> >> view inserted into such a file.
> >>
> >> Is that possible? does anyone have any suggestions or places i can
> >look for
> >> utilities do do such a task?
> >>
> >> Your comments will be much appreciated - even if I have to go back
to
> >them
> >> and say its impossible because of reasons a,b,c...
> >>
> >> Many thanks in advance
> >
> >
>
Kris Eiben at 2007-11-11 23:20:09 >
# 4 Re: htlm page to.... doc or txt file
Yep, look into MIME types.

"Smart" <martinlewis@lloydjames.com> wrote:
>
>Thanks Kris thats great!
>
>Is there some similar contenttype for a text file?
>
>
>
>"Kris Eiben" <eibenkthisisforspammers@yahoo.com> wrote:
>>Try adding these to the top of the ASP page that displays the current
>>record on-screen:
>><%
>>Response.ContentType ="Application/vnd.ms-word"
>>Response.AddHeader "Content-Disposition","inline;filename=myWord.doc"
>>%>
>>The page will open in Word, pretty much as if you opened the same page
>>in the browser (you may have to play with the formatting a bit).
>>
>>"Smart" <martinlewis@lloydjames.com> wrote in message
>>news:3da2dbf6$1@10.1.10.29...
>>>
>>> Can anyone help me - is the following idea do-able?
>>>
>>> I have been asked to insert a button onto our company website that
>>allows
>>> the user to click a button and the current record from an asp page
>>will be
>>> saved into a usable text file or word document.
>>>
>>> All they are after is the text - no html codes. Imagine the screen u
>>are
>>> view inserted into such a file.
>>>
>>> Is that possible? does anyone have any suggestions or places i can
>>look for
>>> utilities do do such a task?
>>>
>>> Your comments will be much appreciated - even if I have to go back to
>>them
>>> and say its impossible because of reasons a,b,c...
>>>
>>> Many thanks in advance
>>
>>
>
Q*bert at 2007-11-11 23:21:10 >
# 5 Re: htlm page to.... doc or txt file
1. {\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0 stshfbi0\deflang1033\deflangfe1033

2. \par }}

Read line 1 with ReadLine or ReadAll method and then call your record and
then ReadLine or ReadAll # 2.

Above line is RTF for word document. That is all you need to generate a word
document.

Later!!
ASP Learner at 2007-11-11 23:22:14 >