OLE Automation by Javascript

  • Thread starter Thread starter Kosic
  • Start date Start date
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.
 
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 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.
 
Back
Top