by Kevin L. Warnock - Document Automation Systems
Editor's Note : One of the cool things you can do with ASP is generate documents server-side and then do something with them (either download them for viewing in the browser, or whatever). However, this technology is so new, I suspect that many of us just aren't using it yet. Kevin L. Warnock runs Document Automation Systems LLC, which sells the Web Word Wizard - an ASP addon which makes the process of Word document creation a snap. Take a look at the demo if you don't believe me - it's very clever. As such, he's had more experience in this area than most of us, and the following tips are taken (with his permission) from recent answers in the ASP newsgroup.
Activating Password protected Word documents.
When a user tries to activate / download a password-protect document, IE 3 generates a copy of Word, then promptly fails to use it, preferring to generate another copy of IE and show the Word document embedded in that. This may seem like aberrant behaviour, but there is an explanation.
Word is popping up so the Word document can ask you for its password. Once you supply it correctly, Word is no longer used and the document opens in place in another new browser. If you generate to RTF there is no concept of password, since RTF files are ASCII and could be read with Notepad. If you click on an RTF link in our demo system, the document will just load directly into a new browser. The reason we use a new browser is if one loads a document in-place into a frame, you don't get many of the Word menu items and the toolbar, which makes the document difficult to do anything with in the browser.
We also didn't want to replace our site frameset with the draft document, since users would get confused and not know how to continue to navigate our site. Seems to be the way Microsoft designed in-place activation with password protected files, so I don't think there is any solution. If anyone has one, please let me know.
Which, of course, begs the question "Why protect the Word document?".
Since Word saves the output to a directory under wwwroot, all the files there are publicly readable. That means a nosy person could just start typing random urls to read other people's documents. To make that much more difficult, we apply a read and write password to the Word 97 files.
Then a hacker could download the file, but would then have to crack Word 97 security before they could read the document. I understand the security in Word 97 is much better than the weak password security in Word 6/7. For the best security, the site could be modified to e-mail PGP encrypted documents.
Excel Fails to activate correctly.
Some users have had problems where, despite running and appearing just fine, Excel won't do anything Server-side at all. Logging on to the server, it will run just fine, but from ASP - nada! Only a reboot solves matters.
Normally, the problem is the Office Assistant, that paper clip helper that pops up to annoy many people. The Assistant pops up to greet you the first time you use each of the Office apps from a particular NT account. You must dismiss the dialog that pops up to introduce the Assistant before you can use the application. You have already dismissed that dialog under the account you are logged into interactively. But Excel runs under the special NT account named SYSTEM when you invoke it from ASP. Nobody has dismissed the Assistant dialog box under that account, so Excel will hang and require a reboot every time, since you can't log into the SYSTEM account directly to dismiss the dialog yourself.
The solution is easy. Uninstall the Assistant, using the Office setup CD. You may need to uninstall the entire Office suite, reboot and then delete the Office directory tree and Registry tree for this to work. The Office Assistant is a check box on one of the installation dialogs.
While you are at it, remove Find Fast, since this will consume vast amounts of CPU to index your files on the server, something you can probably live without!