Run Word's Macro from command button

T

Tim

Hi guys,

I have a word document called Test.doc which contained a
macro called mcrTest.

I wanted to create a command button on a form to launch
test's mcrTest and without the macro warning message
(Enable or Disable macro : I want enable the macro).
After mcrTest finished its job, I wanted Test.doc could be
auto closed without the message "Do you want to save the
changes you made to Test.doc"

Could anyone help me to do it?

Thanks in advance,

Tim.
 
T

Tim

JulieD,

Thanks.

Tim.
-----Original Message-----
Hi Tim

you might be better off posting this in a word newsgroup -
microsoft.public.word.vba.beginners - is a good one

However, to answer your question ... the macro warning dialog will always
come up unless you do one of two things, change the security level of word
to LOW (tools / macro / security - 2nd tab) or get and include a digital
signature (have a look at help in VB Editor screen for more info on digital
signatures).

as for autoclosing the document the code is
ActiveDocument.Close wdPromptToSaveChanges

Hope this helps.
Regards
JulieD




.
 

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