.OnAction only works in document with the code
I'm using Word version 2007.
I created a new command bar control that calls a macro like this:
With cbcNewMenu.Controls.Add(Type:=msoControlButton)
.Caption = "ConvertTable"
.OnAction = "mod100Procs.UpdateTable"
End With
The macro only works on the document that contains the VBA code. If I try to use it on any other document I get a "The macro cannot be found... message.
I've tried this:
With cbcNewMenu.Controls.Add(Type:=msoControlButton)
.Caption = "ConvertTable"
.OnAction = "'" & Thisdocument.name & "'!mod100Procs.UpdateTable"
End With
but that doesn't work. What am I missing?
|