Secondary clipboard

CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

This is three very simple macros, which implement a secondary clipboard. While not everyone would use it, I have found to be quite useful.

Example: I use Ctrl+C, Ctrl+V and Ctrl+X for the Windows clipboard, and map these macros in as Ctrl+Shift+C, Ctrl+Shift+V and Ctrl+Shift+X.


‘ Three simple macros to implement a secondary clipboard

‘ Global to act as clipboard
Dim g_lpszSecondClipBoard
g_lpszSecondClipBoard = “”

Sub SecondaryClipBoardCut()
‘DESCRIPTION: Performs a cut of current selection to a secondary clipboard.
g_lpszSecondClipBoard = ActiveDocument.Selection.Text
ActiveDocument.Selection.Text = “”
End Sub

Sub SecondaryClipBoardCopy()
‘DESCRIPTION: Performs a copy of current selection to a secondary clipboard.
g_lpszSecondClipBoard = ActiveDocument.Selection
End Sub

Sub SecondaryClipBoardPaste()
‘DESCRIPTION: Performs a paste of secondary clipboard to the current selection.
ActiveDocument.Selection = g_lpszSecondClipBoard
End Sub

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read