OLE Automation by Javascript

K

Kosic

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.
 
D

Dmitriy Lapshin [C# / .NET MVP]

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).
 
T

Tim Burda

Dmitriy Lapshin said:
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 said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top