Word Context Menu's

S

SiJP

Getting some serious brain ache over this ;)

(OS=XP Pro, Word=11.0)

My set up is as follows. I've a document template (myForm.Dot) which
contains code to add items to the Context menu's.

The code for each item is as follows:

Set cb_ctl =
CommandBars(ShortCutMenu(i)).Controls.Add(msoControlButton)
With cb_ctl
.Caption = "Use ET" 'Changes for each button
.OnAction = "=fUseET()" 'Changes for each button
End With

When I open a new document (based on the template) the menu items are added
to the context menu (yay!)... however, when I click on each item I'm not as
lucky.

I receive the message (and apologies in advance for its length):

------------------------------ SNIP ----------------------------------------
You may encounter this error for the following reasons:
Macro security is set to:
Very High and the application encounters a signed macro, but the macro was
automatically disabled. Use the following procedure to enable the macro:
Select the Tools menu option and then select Macro and Security. In the
resulting Security dialog, set the security level to High by clicking the
High radio button.
Close the file and any other instances of the application currently running
on the computer (close all applications that also use the application you are
currently running).
Open the file again and examine the certificate of trust details and set the
Always trust macros from this publisher box if you trust the certificate
issued by the publisher.
Click the Enable button to allow the macro to run.
High and the application encounters a signed macro, but you selected Disable
when prompted by the macro warning dialog when opening the file. Use the
following procedure to enable the macro:
Close the file and any other instances of the application currently running
on the computer (close all applications that also use the application you are
currently running).
Open the file again and examine the certificate of trust details and set the
Always trust macros from this publisher box if you trust the certificate
issued by the publisher.
Click the Enable button to allow the macro to run.
High or Very High and the macro was not signed and was automatically
disabled by the application. Use the following procedure to enable the macro,
if you have verified you can trust the source of the unsigned macro:
Select the Tools menu option and then select Macro and Security. In the
resulting Security dialog, set the security level to Medium by clicking the
Medium radio button.
Close the file and any other instances of the application currently running
on the computer.
Open the file again and click the Enable button when prompted to allow for
the unsigned macro to run.
When you have accepted the macro, return the macro security level to its
previous setting.
Another instance of your application has a lock on the security settings and
is disallowing any changes to security settings.
It is recommended to close all Office related applications or other
instances of the same application when you attempt to make changes to your
security settings.
Visual Basic for Applications (VBA) is not installed on your computer.
If VBA is not installed, it is not possible to accept certificates of trust
attached to VBA macros. Therefore, any VBA macro attempting to run, even with
an attached certificate of trust, cannot be run because the necessary macro
interpreter is not installed on the system. Two scenarios can cause this
error:
Your administrator chose not to install VBA
The version of Office you are running does not install VBA by default
If you are running an instance of Office that does not provide VBA as an
installable feature, you will need to upgrade your version of Office to run
VBA macros.
The certificate of trust is invalid - (when this occurs, you cannot select
the Enable button).
The certificate is no longer trusted, was revoked by the issuing authority,
or is damaged. There are several other possibilities which you may need to
explore as to why the certificate is no longer recognized as valid by your
system. It is recommended that you not trust or run a macro that has an
invalid certificate.
A troubleshooter help topic is available online regarding this issue.
------------------------------ SNIP ----------------------------------------

After revewing the items in the list, I conclude that none apply to my set
up (Macro settings are medium, VBA obviously installed, certificates are
valid etc).

The Cruncher... where've I gone wrong!

Also, just for kicks... how the heck do I add in images to these buttons
through VBA? I cant seem to find any properties for this... As an
alternative I've seen the PasteFace function that'll use the clipboard
contents, but I've no idea how to get my icon file onto the clipboard,
programatically.

****************************************
Laugh, and the world laughs with you. Trip over in the middle of a busy
shopping centre whilst briefly holding a thick vaniilla shake, and watch the
world have hysterics at your expense..
 

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