Hello all:
One of my clients wanted a quick and cheap method to save a web-based report
as a Word document. My quick solution was to have, at a button click, the
page resubmit itself, but with an additional header in the file:
<% 'from an ASP page
strFileName = "I_generate_a_filename_here.doc"
response.ContentType = "application/msword"
Response.AddHeader "content-disposition", "attachment; filename=" &
strFileName
%>
This has worked like a charm, the user is prompted to save or open the file;
Word then interprets the HTML as a document, and displays it correctly.
But my client has a user that is still using Word 97 and is experiencing
difficulties in opening the report in Word. She gets an error, "The file
appears to be corrupted." I set up a test environment (Win2K, Word 97 SR-2)
and have been unable to duplicate the error, but have encountered a new
issue:
If I open Notepad, bang out a simple HTML page, and save it as a .doc file,
Word 97 opens it and displays it as plain-text, complete with the tags. If
I do the same on Word 2K, the file displays as I would expect (<h1> is big
and bold, <p> tags create paragraphs, etc.) ((And if I save the same file
from Word 2K, Word 97 has no problem opening it, but Word 2K has added a ton
of binary data to it. But I digress....))
I have been through the Office 97 install disk and Microsoft's knowledge
base and downloads, but have not found anything that works in these
situations. Any clue you can give me will be greatly appreciated.
TIA,
Dave
lostinspace - 30 Jun 2004 21:29 GMT
----- Original Message -----
From: "David Carnes" <>
Newsgroups: microsoft.public.word.web.authoring
Sent: Wednesday, June 30, 2004 3:31 PM
Subject: Word 97 - failure to open HTML saved as .doc
> Hello all:
> One of my clients wanted a quick and cheap method to save a web-based report
[quoted text clipped - 29 lines]
> TIA,
> Dave
Seems a bit complicated to me Dave?
Why not just instruct your client on how to use the SAVE AS in his browser?
Teaching your client how to use copy and paste simultaneously?
David Carnes - 30 Jun 2004 22:31 GMT
> Seems a bit complicated to me Dave?
Thank you for your reply. I realized that I was coming at this from a
programmer's point of view, and you made me try a low-tech solution. The
report opens in a new browser window in which I've disallowed toolbars,
menubars, etc., so I tried Ctl-A and Ctl-C (or right-click, Select All,
right-click, Copy). Then I opened Word 2K and pasted. Viol?, the report
looked good, same as the web version. But then I went to my test machine,
and tried the same with Word 97. The text transfered OK, but I lost all
formatting and tables. I might as well have pasted into Notepad. Hmmm....
> Why not just instruct your client on how to use the SAVE AS in his browser?
> Teaching your client how to use copy and paste simultaneously?
Well, therein lies the rub. This is a web app that allows engineers to to
create applications to be submitted to a state agency on behalf of their
clients, so I am several steps removed from the end user. I made things
compatible for both Netscape and IE (didn't worry about Opera, et al, my
apologies to the die-hard open source folks) but I didn't have Office 97
available during the beta testing. So far this has been the only
troublesome case, but perhaps this will provide enough impetus for my client
to get a PDF creator for the web server, so that we can generate PDF files
on the fly and set them down the wire. That would remove a lot of
compatibility issues.
Once again, I thank you for your time.
Ciao,
Dave
David Carnes - 01 Jul 2004 19:04 GMT
Turns out that everything works properly for the user, with the exception of
one dataset. This tells me that there must be some character that the user
has entered that is throwing Word 97 off. Time for me to revisit that web
page and enhance its error-trapping.
Ciao,
Dave