Unable to hide Save and Save As menu items

F

foomonkey

I have an InfoPath form that I want to use the Submit feature on.
Therefore, I do not want the users to have the Save and Save As menu
items available. I found code to disable these items like this:

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

I put this code in the XDocument::OnLoad event. Unfortunately, this
does not seem to do anything.

Any ideas?

Thanks.
Andrew
 
D

darko

In the Menu - Tools->Form Options... -> Open and Save (tab)
uncheck the save and save as.. check box
 
F

foomonkey

What do you know. That worked! Makes you wonder why long, technical
articles are written on how to do this with code.

Thanks!
Andrew
 

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