Word

Adding Paste Special to the Right-Click Menu

Ease of Use

Easy

Version tested with

2000 

Submitted by:

mark007

Description:

This will allow you to paste special by simply right-clicking in a document and selecting paste special to save you having to use the toolbar at the top. 

Discussion:

Paste special is a very useful feature and this code will speed up your productivity by making it easily available. 

Code:

instructions for use

			

Sub AutoExec() Call AddPasteSpecial End Sub Sub AddPasteSpecial() Dim cb As CommandBar Dim c As CommandBarButton Set cb = Application.CommandBars("Text") Set c = cb.FindControl(, , "VBAxPasteSpec") If c Is Nothing Then Set c = cb.Controls.Add(msoControlButton, 755, , 4, True) With c .Caption = "Paste &Special..." .Style = msoButtonCaption .TooltipText = "Paste Special" .Tag = "VBAxPasteSpec" End With End If End Sub

How to use:

  1. Copy the code above.
  2. Open Word.
  3. Hit Alt+F11 to open the VBE.
  4. In the left-hand pane right click the document and select insert module
  5. Double click on the newly created module
  6. Now paste the code above into the code pane.
 

Test the code:

  1. Close word, saving the Normal template when asked.
  2. Re-open word and right-click on the document.
  3. The Menu item should now be here.
 

Sample File:

Sample.zip 8.51KB 

Approved by mdmackillop


This entry has been viewed 331 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express