Active X Security Problem?

K

Kent

Hi all,

I've figured out how to enter a Javascript (actually, somebody just gave me
a code snippet, I have no clue) for a button click that will launch a
document in Microsoft word. It works fine when I'm in design mode and do a
"preview". Problem is that when I publish the form, the darn thing gives me
the following error:
-----------------------------------------------------------------------------
Infopath cannot complete this action because of an error in the form's code.

The following error occurred:

Automation server can't create object
File:script.js
Line:2
---------------------------------------------------------------------------------

Here's the code snippet, line 24 of the script that appears to making this
cough:
-----------------------------------------
line 22 function CTRL1224_5::OnClick(eventObj)
line 23 {
line 24 var wd = new ActiveXObject("Word.Application");
line 25 wd.visible = true;
line 26
line 27 var wdDoc = wd.Documents.Open
line 28 ("C:\\LC\\Templates\\Help Jobsite Bulletin Board Postings.doc");
line 29
line 30 }
-------------------------------------------------------------
I also notice that I get the following warning when I click the button from
preview in design mode: "An ActiveX control on this page might be unsafe to
interact with other parts of the page. Do you want to allow this
interaction?"

I'm presuming that this might be related, and perhaps there is some security
setting relative to AcitveX controls that I need to change to make this all
work correctly.

Appreciate any assistance provided.

Cheers,

Kent in Anchorage
 

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

Top