PDA

View Full Version : disable menu items



talytech
07-30-2009, 10:32 AM
I would like to disable the Send menu item and the Save As menu item from the File menu. Is there a way to do that? My purpose is to keep the end user from saving a copy of the form and I want to force the end user to use the auto buttons to send the form via email.

Bob Phillips
07-30-2009, 10:40 AM
Sub DisableItems()

With Application.CommandBars(1).Controls("File")

.Controls("Save As...").Enabled = False
.Controls("Send To").Enabled = False
End With
End Sub

talytech
07-31-2009, 05:42 AM
thank you! :) that worked.

talytech
04-07-2010, 10:26 AM
Sub DisableItems()

With Application.CommandBars(1).Controls("File")

.Controls("Save As...").Enabled = False
.Controls("Send To").Enabled = False
End With
End Sub


The above code works for my worksheet only. When I send the form to someone else to open, they still have the Save As & Send To items active. How do I get the workbook to disable those menu items for whomever uses the Form?

Bob Phillips
04-07-2010, 10:30 AM
Put it in the Workbook_Open event, and then re-enable in Workbook_Close.

GTO
04-07-2010, 02:41 PM
Bob,

A meeting after my (#*(R&#@!!! current hours of work, so likely to be less than articulate...

I would think app level stuff better to be fired by (de)activate events(s). That way, still happens upon open/close, but does not goober commands w/other open wb's.

If I am missing the mark (no pun), please correct me.

Aussiebear
04-07-2010, 02:47 PM
Bob,

A meeting after my (#*(R&#@!!! current hours of work, so likely to be less than articulate...

With 9.7% unemployment in the USA, I'd be grateful for any employment at this time of the year, were I living in the country.

Bob Phillips
04-07-2010, 02:52 PM
Mark,

I don 't think app events would be appropriate. I wouldn't have thought it needs switching on as a file is opened/closed, it would seem either to be required all the time (keep the workbook open), or only whilst that workbook is open.

GTO
04-07-2010, 03:34 PM
With 9.7% unemployment in the USA, I'd be grateful for any employment at this time of the year, were I living in the country.

Hi Ted,

My comment was meant only as a minor bit of a 'whine'/joking w/Bob, as w/21+ years on and issues I am facing (not personal 'issues', the component's), as well as getting older and a stronger 'body clock', Shift 3 is taking a harsher toll this time around. In gist - I are too damn tired...

I utterly agree w/your statement however, and try and remain mindful of blessings. Certainly with the world being such a 'smaller' place (video and quick info at one's fingertips), it is easy to remind one's self of other's challenges.

Probably won't get to see your response til later, but how is the economy 'down there' (unemployment rate wise)?

Bob,

Well...leastwise I pre-emptively apologized for being 'dopey/stoopid tired'. Thank you for being empathetic/patient.


I don 't think app events would be appropriate.

On laptop, so won't take time to find the embarassed icon, but mis-communicated... If understanding response, I did not mean to refer to creating app level (Class) events. I meant that when using workbook events, it seems to me, that using activate/deactivate is better to handle such 'stuff' (less than clear on my part), when said 'stuff' is application level.

I can see that my verbiage is slipping quickly, so by example, if I am substituting the menubar (or a command), if I use the activate/deactivate events, then only the wb I want is affected. If I use Open/Close, then another open wb in the same instance can be affected.

I sure apologize if I am still bein unclear; and as priorly stated, I want to know if my logic is off-track.

A great day/eevning to you both :-)

Mark

Bob Phillips
04-08-2010, 01:17 AM
Ah, sorry Mark, I definitely read it as application level events. In that instance, I can see the rationale for your comment, and it is certainly something the talytech should consider. As ever with these things, it all depends on what he actually wants to do (as against what the truncated sentences that we post say) :)

No need for apologies, I find you disarmingly polite (I could afford some more myself), and I hope that my response to you reciprocates. I could see from your opening lines you were undergoing some frustration even whilst doing your bit for the state of Arizona.

GTO
04-08-2010, 05:14 AM
...I find you disarmingly polite...

Ahhh yes! My plan to take over the world is working :uptosomet(evil laughter trailing off into the distance...)


I could afford some more myself...

Belay that, you are fine.


...I could see ... you were undergoing some frustration...

Nicely understated and yes sir - I could have burned holes in the damn screen with my bloodshot eyes...(LOL)

Well, I see that #9 is still not going to win any awards in literature, but I'm glad I was less muddled :-) I do catch myself being overly polite occassionally, unintentional of course (but I'm not apologizing for that, cuz well... it would just be too weird! An apology squared? Hee-Hee)

@talytech:

I should quit hijacking your thread :o: ; is your code working now?

Mark