Way to edit Microsoft Word 2013 right-click menu?

Products and tips

Moderator: Site Mods

Post Reply
User avatar
pschroeter
Silver Member
Silver Member
Posts: 283
Joined: 2007 Jan 27, 00:46

Way to edit Microsoft Word 2013 right-click menu?

Post by pschroeter »

Can someone help me with directions to edit the text right-click menu in Word 2013? Or point me to better directions with VBA or an addin? I recently upgraded from Word 2002 and I am shocked by what Word no longer lets me do, such as customize right-click menus and other parts of the interface. I want to add a few commands back into my right-click text menu, ones that have been there for the past ten years, and which I am constantly fighting muscle memory to use.

I have found only one webpage with VBA directions at:

http://gregmaxey.mvps.org/word_tip_page ... _menu.html

And this post in a forum:

Here's some sample code to put an item on the Text context menu to run
the AddBullets macro; it assumes that the AddBullets macro and this
AutoExec macro are both in Normal.dotm. The .OnAction property is the
one that specifies which macro to run when the menu item is clicked;
the .Tag property is just an arbitrary string that can be used as a
sort of name for the item.

The Before parameter of the Controls.Add method is the numeric
position where the item will be added.

Sub AutoExec()
Dim cb As CommandBar
Dim ctl As CommandBarButton
On Error GoTo bye

CustomizationContext = NormalTemplate
Set cb = CommandBars("Text")
Set ctl = cb.FindControl(Tag:="AddBullets")
If ctl Is Nothing Then
Set ctl = cb.Controls.Add(Type:=msoControlButton, _
Before:=9, Temporary:=True)

With ctl
.Caption = "A&dd bullets"
.Tag = "AddBullets"
.OnAction = "AddBullets"
End With
End If
bye:
End Sub

If you want to remove the item from the menu, you can do it like this:

Sub RemoveAddBullets()
Dim cb As CommandBar
Dim ctl As CommandBarControl
CustomizationContext = NormalTemplate
Set cb = CommandBars("Text")

For Each ctl In cb.Controls
If ctl.Tag = "AddBullets" Then
ctl.Delete
End If
Next
End Sub

Microsoft must really think their new Word interface is wonderful if they make it this hard to change. I don't like the Ribbon in complicated programs. I have Word set up where I use the Quick Access tool loaded with icons for most of my work, and only occasionally use the Ribbon ,set to auto-hide, like a series of menus which open sideways.

Edit June 15
I actually figured out how to get this to work on my own. I somehow missed that it was an AutoExec macro which I know what to do with. All I then had to do was change the dummy macro name "AddBullets" to my macro name. I even figured out how to put three of my macros into the Word 2013 Text right-click menu. Oh happy day. In Word 2002 this would have taken me five minutes to set up.
Last edited by pschroeter on 2013 Jul 15, 07:33, edited 1 time in total.
User avatar
nikos
Site Admin
Site Admin
Posts: 15799
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: Way to edit Microsoft Word 2013 right-click menu?

Post by nikos »

there are some office FAQs and support forums here
http://office.microsoft.com/en-us/support/?CTT=97
Post Reply