Question

We have a Word VBA macro delivered with a Word Template as part of our app, that alters the ribbon Save functionality to a custom upload into our app.

I don't fully understand how the ribbon customisation has been built, but it generally works for all our customers except for at one particular customer site where they have a particularly locked down Windows profile in use. The code below works for an "admin level" user to trigger the custom upload, but fails for a user with the locked down profile.

The customer is unable to give much information about what is unusual about the profile, so I'm hoping someone would be able to give some pointers about where to look for profile settings that could be preventing the upload process from triggering from the ribbon.

Public Sub uninstall()

   Set iControl = CommandBars("File").FindControl(ID:=3)
   iControl.OnAction = ""

   Set iControl = CommandBars("File").FindControl(ID:=106)
   iControl.OnAction = ""

   Set iControl = CommandBars("File").FindControl(ID:=752)
   iControl.OnAction = ""

   Set iControl = CommandBars("File").FindControl(ID:=4)
   iControl.OnAction = ""

   Set iControl = CommandBars("Standard").FindControl(ID:=3)
   iControl.OnAction = ""

   Set iControl = CommandBars("Standard").FindControl(ID:=2521)
   iControl.OnAction = ""

End Sub

Public Sub doSave(control As IRibbonControl, ByRef cancelDefault)

   UploadFile ("Save")

End Sub

Public Sub UploadFile(context As String)

   ' Custom upload functionality code

End Sub
Was it helpful?

Solution

The culprit was this setting in Group Policy:

Microsoft Office 2010/Global Options/Customize: Disable UI extending from documents and templates: Enabled

This policy setting controls whether Office 2010 applications load any custom user interface (UI) code included with a document or template. Office 2010 allows developers to extend the UI with customization code that is included in a document or template. If you enable this policy setting, Office 2010 applications cannot load any UI customization code included with documents and templates. If you disable or do not configure this policy setting, Office 2010 applications load any UI customization code included with a document or template when opening it.

It would appear that this setting was, as described, preventing our customisation of the ribbon from loading. No error was being provided (not sure if one could be expected in the circumstances), and this isn't an option that is visible in Words options screens.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top