Error disabling command bars

L

Laura Villa

Hi everyone,
I'm quite new in infopath development. I tried to follow the instruction of
the article:

http://msdn.microsoft.com/library/d...foPathCustomizingInfoPathMenusandToolbars.asp

and wrote the following code in the OnLoad event procedure of the form:

var objCommandBars = Application.ActiveWindow.CommandBars;
var myControls = objCommandBars.FindControls(1,3);
for( var enumtor = new Enumerator(myControls) ; !enumtor.atEnd();
enumtor.moveNext() )
{
enumtor.item().Enabled = false;
}

I saved the form and then opened it again, in order to check
if the button is disabled. A Js script error occurs: "Permission Denied" on
the first line (var objCommandBars = Application.ActiveWindow.CommandBars;)

Any idea about that?
Thanks!

Laura
 
M

mary_l

Hi!

Did you solve the problem with the permission denied error? I have the
same problem as you with the error at

var objCommandBars = Application.ActiveWindow.CommandBars;

and dont know what could cause it.
 
A

Anuma

Hi,

You have to give "Full-Trust" to your form,

Give the full-trust, then try ,

I hope this will help you,

Thanks.
 
Top