Macro Button doesn't work

B

Bill Cunningham

Why doesn't my macro button work. Here is the field code:

{ MACROBUTTON "SendButton" Click Here To Send }

This macro button is supposed to call a macro named:

Sub SendButton()

which DOES exist in the document.

When clicking the macrobutton, the SendButton macro is not
called. I can run the SendButton macro from witin the VBA
Editor just fine. It's the call from the macrobutton that
isn't happening.

I originally set this up last week, and it was working
then. Now, although no alterations of any kind have been
made to the document or the field code of the macro
button, suddenly it no longer works.

I'm using Word 2003 in Windows XP, and I'm completely
stumped as to why this has suddenly ceased to function.
 
B

Bill Cunningham

Thanks Johnathan, actually, since posting this I went back
and took those quotes off. The problem seems to be when I
protect the document as a Form.

As long as the document is unprotected, the button works
fine. But when I protect it, the button no longer works.

I thought MacroButtons were supposed to function in
protected documents. Am I wrong?
 
B

Bill Cunningham

Hello, I just solved my own problem.

The problem is, when the document is protected as a form,
you can't doubleclick on the MacroButton, as one click
outside of a Formield in a protected document just sends
you immediately to the next available form field.

You have to set the document so that it will allow the
MacroButton to be triggered by only one single click.

To do this, I set up the following code:

Sub AutoOpen()
Options.ButtonFieldClicks = 1
End Sub

Sub AutoNew()
Options.ButtonFieldClicks = 1
End Sub

This will tell the document (a template, actually) that
wheniever it is opened, no matter whether that is as a
template or as a spawned off word doc, to make sure it
accepts just one mouse click to trigger a field's
functionailty, instead of two.

When this is done, the button works in a protected form.

Thanks all! -Bill
 

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