Add Paste Unformatted Text to the right click menu

S

Sandi V

Another listserve pointed me to the following code that adds Paste Special to
the right-click menu. Can anybody help me so one step further...instead of
having to select a format and click OK in the Paste Special window, can I
give the user Paste Unformatted Text right there on the right-click window?
(ABOVE regular Paste if possible?)

Thanks in advance!
Sandi

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
 
D

Doug Robbins - Word MVP

Create a macro as follows:

Sub PasteUnformatted()
Selection.Range.PasteSpecial DataType:=wdPasteText
End Sub

Then Customize the Text ShortCut menu by selecting this macro from the
Macros category of the Commands tab of the Customize dialog. After dragging
the macro on to the Short Cut menu, you can right click on it and then edit
the name so that it just reads PasteUnformatted.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
S

Sandi V

That's great. Thanks!

Doug Robbins - Word MVP said:
Create a macro as follows:

Sub PasteUnformatted()
Selection.Range.PasteSpecial DataType:=wdPasteText
End Sub

Then Customize the Text ShortCut menu by selecting this macro from the
Macros category of the Commands tab of the Customize dialog. After dragging
the macro on to the Short Cut menu, you can right click on it and then edit
the name so that it just reads PasteUnformatted.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Doug Robbins - Word MVP

My pleasure.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
A

AJPL

Hi

Please can you explain how can you add the paste special code to the tables
(and for that matetter any) shortcut menu?

Regards...

Anthony
 

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