472,121 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

OPENING WORD2000 DOCUMENT WITH JAVASCRIPT

Hi Folks,

I'm wondering if someone has already succeed to open a word2000
document located on server side with javascript code executed by a web
browser on client side.

In fact, i make it without any problem when the client use Word XP &
2003 but no result with Word 2000.

Any suggestions are welcomed,

Thanks in advance for you help,

Cedric

Jun 28 '06 #1
5 2448
Cedric wrote:
Hi Folks,

I'm wondering if someone has already succeed to open a word2000
document located on server side with javascript code executed by a web
browser on client side.

In fact, i make it without any problem when the client use Word XP &
2003 but no result with Word 2000.

Any suggestions are welcomed,

Thanks in advance for you help,

Cedric


Hi,

It depends on what you mean excactly by 'opening a word document'.
Do you mean that the URL of a window points to some word-document on your
server?

In that case most browsers will open it. IE will open it in its own
IE-window. Other browsers might suggest, but ask you first, if you want to
open the document with the default extensionhandler.

I do not expect a difference for word2003 and word2000, so I am suprised you
find one.

Could you show us the code you use?

Regards,
Erwin Moller
Jun 28 '06 #2
Hi Erwin,

Thanks to follow my case.

Exactly, i mean that the URL of a window points to some word-document
on my server.
But if i use a network path or local path instead the URL the
application works fine.

I get this problem only with Word2000.

Here a piece of my javascript code :

function opendoc(){

if (window.ActiveXObject) {
try {
var app_word = new ActiveXObject("Word.Application");
var doc_word = new ActiveXObject("Word.Document");
} catch (e) {} }

if (!app_word) {
alert('Abandon : Impossible de créer une instance
Word.Application.');
return false;
}
else
{
// var oPathTemplate = "C:\\temp\\Template.dot"
var oPathTemplate = "http:////myserver///Modeles//Template.dot"
try {

/* Add document */
doc_word = app_word.Documents.add(oPathTemplate);

if (!doc_word) {
alert('Abandon : Impossible de créer un document Word.');
app_word.Quit(0);
return false;
}

/* Activation document */
doc_word.Activate();

/* Make it visible*/
app_word.Application.Visible = true;
}

}

Erwin Moller a écrit :
Cedric wrote:
Hi Folks,

I'm wondering if someone has already succeed to open a word2000
document located on server side with javascript code executed by a web
browser on client side.

In fact, i make it without any problem when the client use Word XP &
2003 but no result with Word 2000.

Any suggestions are welcomed,

Thanks in advance for you help,

Cedric


Hi,

It depends on what you mean excactly by 'opening a word document'.
Do you mean that the URL of a window points to some word-document on your
server?

In that case most browsers will open it. IE will open it in its own
IE-window. Other browsers might suggest, but ask you first, if you want to
open the document with the default extensionhandler.

I do not expect a difference for word2003 and word2000, so I am suprised you
find one.

Could you show us the code you use?

Regards,
Erwin Moller


Jun 28 '06 #3
Cedric wrote:
<snip>
// var oPathTemplate = "C:\\temp\\Template.dot"
var oPathTemplate = "http:////myserver///Modeles//Template.dot"

<snip>

In javascript string literals the backslash character has a special
meaning, in that it is the escape character. So if you want to write a
Windows path the backslashes in the path need to be escaped by
preceding them with a backslash each. The forward slash character has
no special meaning and so your HTTP URL is literally the characters you
wrote, and is extremely unlikely to be effective. Something more like:-

var oPathTemplate = "http://myserver/Modeles/Template.dot";

- would be expected.

Richard.

Jun 28 '06 #4
Hi Richard,

Thanks, that's true what you said. but i still get an error, even if i
write well my URL :
var oPathTemplate = "http://myserver/Modeles/Template.dot";

May be you have anothers ideas about this.

Regards,

Cedric

Richard Cornford a écrit :
Cedric wrote:
<snip>
// var oPathTemplate = "C:\\temp\\Template.dot"
var oPathTemplate = "http:////myserver///Modeles//Template.dot"

<snip>

In javascript string literals the backslash character has a special
meaning, in that it is the escape character. So if you want to write a
Windows path the backslashes in the path need to be escaped by
preceding them with a backslash each. The forward slash character has
no special meaning and so your HTTP URL is literally the characters you
wrote, and is extremely unlikely to be effective. Something more like:-

var oPathTemplate = "http://myserver/Modeles/Template.dot";

- would be expected.

Richard.


Jun 28 '06 #5
Cedric wrote:
Hi Richard, <snip> May be you have anothers ideas about this.

<snip>

Maybe, but first I would have to read what you have written and as you
have top-posted it and not quoted the context of your responses the
effort of reading it has passed over the threshold of willingness.

Richard.
Jun 28 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Nikolai Kirsebom | last post: by
2 posts views Thread by Jawahar Rajan | last post: by
3 posts views Thread by Display Name | last post: by
4 posts views Thread by Amir | last post: by
14 posts views Thread by D. Alvarado | last post: by
4 posts views Thread by d4rkn1ght | last post: by
2 posts views Thread by rlu | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.