|
-
July 22nd, 2002, 10:08 AM
#1
how to save doc file in html page
hi,
i am faced with a strange n peculiar stupid problem. I am giving a *.doc file in a href tag of html page and instead of opening the file save dialog box, its opening the file in Browser.
CAn i somehow getover this problem, and prompt the user to save the doc file instead of opening it in browser window itself.
somebody help me pls...
rgds
vinit
-
July 23rd, 2002, 09:59 AM
#2
Just passed by. I'm not quite sure what you mean by
I am giving a *.doc file in a href tag of html page
Do you mean to say that the user presses a link looking like:
http://foo.bar/baz.doc
or that the user is directed to your page like:
http://foo.bar/yourpage.html?document=baz.doc
?
Either way, I think your cances of getting a reply is better in the "Client Side Scripting" forum. This doesn't look like a topic for a "General Discussion" ;-)
Regards,
S. Bro
-
July 26th, 2002, 12:04 AM
#3
i mean some thing like this < a href="abc.doc">XYZ </a>
can i somehow prompt the user to save this file... clicking on XYZ.. now it is opening the file in browser itself
-
July 26th, 2002, 03:10 AM
#4
I think you can do something along the lines of (pseudocode):
Code:
<a href="abc.doc" onclick="doSave(this); return false;">XYZ </a>
<script language="javascript>
function doSave(anchor) {
var w = new ActiveXObject("Word.Application");
w.Documents.Add(anchor.href.value);
var doc = w.Application.ActiveDocument;
doc.SaveAs(documentPath, 0);
doc.Close(0);
}
</script>
You'd have to roam USENET and check the MSDN office documentation for the Word automation API.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|