473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

OLE Automation by Javascript

i wrote this js function in HTML:

function OpenWord()
{
var a = new ActiveXObject("Word.Application"); a.Visible = true;
a.WindowState = 1; window.blur(); a.Activate();
}

if the it runs at localhost, it is OK, but it fail to create object when
running at other client. ( The same Office suite was installed in server &
client).

How to create a new WORD document ? Any ideas in operating VBA on
ActiveXObject? thanks.

Kosic.
Nov 17 '05 #1
2 3109
Hi,

It's generally a wrong thing to do. Office automation objects are not marked
as safe for scripting and therefore an attempt to access such objects from
client-side Javascript will result in denied access unless the website is
being opened in the My Computer zone (which happens when you test the
JavaScript on your development PC).

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Kosic" <ko***@sina.com> wrote in message
news:OG**************@TK2MSFTNGP12.phx.gbl...
i wrote this js function in HTML:

function OpenWord()
{
var a = new ActiveXObject("Word.Application"); a.Visible = true;
a.WindowState = 1; window.blur(); a.Activate();
}

if the it runs at localhost, it is OK, but it fail to create object when
running at other client. ( The same Office suite was installed in server &
client).

How to create a new WORD document ? Any ideas in operating VBA on
ActiveXObject? thanks.

Kosic.


Nov 17 '05 #2
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote in message news:<#H**************@TK2MSFTNGP12.phx.gbl>...
Hi,

It's generally a wrong thing to do. Office automation objects are not marked
as safe for scripting and therefore an attempt to access such objects from
client-side Javascript will result in denied access unless the website is
being opened in the My Computer zone (which happens when you test the
JavaScript on your development PC).

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Kosic" <ko***@sina.com> wrote in message
news:OG**************@TK2MSFTNGP12.phx.gbl...
i wrote this js function in HTML:

function OpenWord()
{
var a = new ActiveXObject("Word.Application"); a.Visible = true;
a.WindowState = 1; window.blur(); a.Activate();
}

if the it runs at localhost, it is OK, but it fail to create object when
running at other client. ( The same Office suite was installed in server &
client).

How to create a new WORD document ? Any ideas in operating VBA on
ActiveXObject? thanks.

Kosic.

I have also had a similiar problem and in addition to the advice
provided by Dmitriy, you may want to try the following:

In the IE Browser, goto to Tools-->Internet options--> Security and
add the server to your list on trusted sites (when prompted, provide
http://yourmachinename as a trusted site). This helped me with my
problem.
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert | last post by:
---EN--- This message has been crossposted in a french speaking newsgroup, english version is at the end. Thanks a lot for your help... --/EN--- Bonjour, Je développe une application...
15
by: qwweeeit | last post by:
Hi all, Elliot Temple on the 1 June wrote: > How do I make Python press a button on a webpage? I looked at > urllib, but I only see how to open a URL with that. I searched > google but no...
2
by: Bart Van der Donck | last post by:
Hello, I'm posting the software for one-FAQ-a-day as described on http://tinyurl.com/qcxw7 (comp.lang.javascript, July 18 2006, titled "CLJ newsgroup FAQ) and on http://tinyurl.com/ppt2s...
0
by: Sharath | last post by:
Quality Globe is Glad to Offer you the Fast Track course on Automation, QTP Basics and Advanced, and Quality Center Starting Date: June 4th, 2007 Timings: 10 AM to 3:30 PM Duration: 50 Hours ...
0
by: Sharath | last post by:
"Inspired" by the huge success of our first two automation fast track batches We are forced to start third fast track automation batch ...
2
ravioliman
by: ravioliman | last post by:
I have written a Delphi single threaded, out-of-process (exe) automation server that I want to execute methods from a HTML page. A. I have been able to launch the server with the following...
0
by: Sharath | last post by:
We are glad to inform you that "Inspired" by the huge success of our first three automation fast track batches We are forced to start fourth fast track automation batch ...
0
by: Sharath | last post by:
We are glad to inform you that "Inspired" by the huge success of our first four automation fast track batches We are forced to start fifth fast track automation batch ...
0
by: dim505 | last post by:
hi friends, I'm new to this forum. I have created and build a dll but at first it was getting the error"Automation server can't create object" after a lot of head ache,I got the script...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.