Disable macro button?

W

Wayne

When a document is opened that contains a macro, a dialog
box opens and the user is asked either to accept the
macro or disable the macro.

Is there a way to force MS Word to close if the user
chooses to disables the Macro?
 
T

Thomas Dietrich

That's close to what I want:
I want my macro to force Word to lower security settings and allow macros, and then once the document is closed it should raise the security settings again....using the macro!

Any ideas?
 
J

JGM

Hi Thomas... or Wayne?

Seriously, think about it... What would be the point of having security
settings if you could write a macro that could bypass those settings? Word
security is flimsy as it is... let's not make it worse!

The only thing you can do along those lines is change the security settings
temporarily once you have code already running. For that, the initial
setting must allow you to run your code in the first place. So, for example,
you could have a template that called on another tenplate, but that would
disable macros before opening that second template so that its Document_New
routines would not be executed... Anyway, this is how I understand it!

You could also look in to signing your macros with a digital signature,
either with selfcert.exe or with third party certification, such as
Verisign. This way, your macro could run on a machine that accepts your
signature, even if its security is set to high.

Cheers!

--
_______________________________________
Jean-Guy Marcil
(e-mail address removed)

Thomas Dietrich said:
That's close to what I want:
I want my macro to force Word to lower security settings and allow macros,
and then once the document is closed it should raise the security settings
again....using the macro!
 
P

Peter Hewett

Hi

You can't change the macro security levels programatically!

If you could and you changed the security level to Low and then the macro
terminated without resetting the security level or failed the security for
ALL templates would be compromised.

HTH + Cheers - Peter
 

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