SendTo

P

Paul W Smith

I have a workbook which I have written code which will not allow the user to
save the workbook unless they have provided specific pieces of information.

I had intended to not allow users to Email the worbook without the specific
information being present. My thought process was if they cannot save it
they
cannot attached it to an Email.

What users have found a way to do is to Email the unsaved workbook using
SendTo.

Can anyone suggest any way I can stop the users doing this?
 
P

Paul W Smith

Just in case anyone ever comes across this post looking for the same
information to was here is a solution. This was suggested to me by Ron de
Bruin.

Use the Workbook Open event to disable the SendTo functionality.

Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=30095)
Ctrl.Enabled = False
Next Ctrl

And to return this functionality to the user in the Workbook BeforeClose
event use:

Dim Ctrl As Office.CommandBarControl
For Each Ctrl In Application.CommandBars.FindControls(ID:=30095)
Ctrl.Enabled = true
Next Ctrl

The ID of the SendTo control is 30095
 

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