unable to restore toolbars after disabling in one infopath templat

M

Michael Lopez

Hello everyone:

I've created an infopath form for which I needed to remove the toolbars. I
know the CommandBar object has level 3 security, so I used regform to issue
full trust privileges to the form. After registering the form locally and
opening the opening the form for data entry, both the edit menu and the "menu
bar" were gone, as expected. The problem now is that when opening any other
infopath form, I'm missing both the edit and "menu bar" toolbar! The other
infopath forms do not have any script in them whatsoever. Going even further,
the above mentioned menu items are now disabled in the base infopath client,
meaning that even with no forms open I still can't access them. Even when
desiging a new form I can't access those menus. I've unregistered the
offending form and restarted my computer. I might be able to enable the menus
through code, but I'd like to know what is wrong. I also know reinstalling
office might be a quick fix, but I'm concerned that the same thing will
happen to the end users of this form. Any help would be appreciated.
 
F

Franck Dauché

Hi Michael,

This is an expected behavior from InfoPath. To solve that issue, open the
"offending" form and change the code that you used to disable the built-in
toolbars to set the Enabled property from "false" to "true". Run the form
again (now you are forcing the Toolbars to show). Close IP. Open a new
blank form, the toolbar are back!

If you want to disable the built-in toolbars for your solution, you need
re-enable them before closing your solution. The best is to build a function
where you pass "false" to disable the toolbars when you start your form, and
"true" when you close it.

Hope that it helps.

Franck Dauché
 
M

Michael Lopez

Thanks Franck,

I've restored the toolbars in infopath and all is right with the world! I
deleted the "offending" form that cause the problem in the first place, so I
created another one and used regform to make it fully trusted. I enabled the
toolbars when running that form and all is well now. Another question though,
how do I capture the close event to reenable the toolbars? I've looked
through the infopath sdk and haven't found a way to trap the close event.

Thanks,
Michael
 
F

Franck Dauché

Unfortunately you can't. There is no OnCLose Event that you can catch. You
need to put a close button on the form and call the cleanup code there.

If my last post was useful, don't hesitate to rate it on the newsgroup, it
may help others to find this answer quicker.

Thanks Michael.

Franck Dauché
 
M

Michael Lopez

Franck,

Just rated your post as "Extremely" useful. Too bad there's no close event.
Thanks again for your help.

Michael Lopez
 
A

Apurv Tiwari

Hi,
I am developing a IP Form on a sharepoint forms library, and IP behaved in
the same manner as it did with Michael.
I have disabled standard and editing toolbars (Formatiing toolbar is
enabled.) The problem I am facing is that, when I open IP in design mode i
dont see any of the toolbars except formatting toolbar, so I cannot access my
js code for the form where i am supposed to revert my logic.

Is there any other workaround, or a key board shortcut to access the Script
in order to edit it?

Any help will be appreciated.

Thanks and Regards,
Apurv Tiwari
 

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