Secondary clipboard

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



Comments

  • best one....

    Posted by Legacy on 07/30/2002 12:00am

    Originally posted by: Divya

    ur article is sooooo fine and very useful.....post many code like this...plz......also u can send private code(new) to the members responding u...(this is my kind plz asked to u)
    

    Reply
  • FIFO clipboard

    Posted by Legacy on 11/25/1999 12:00am

    Originally posted by: Jivko Velev

    Hi guys, 
    
    And here is the FIFO clipboard
    I attach these macros as follows:
    ClipboardCopy() - Ctrl+Ins
    ClipboardPaste() - Shift+Ins
    ClipboardCut() - Ctrl+Del
    ClipboardPasteAll() - Ctrl+Shift+Ins
    ClipboardClear() - Ctrl+Shift+Del
    Sorry about my bad Basic style :))

    Dim clipboard( 33 ) 'allows 32 entries
    first = 1
    last = 1

    Sub ClipboardCopy()
    nextLast = last + 1
    if ( nextLast > 33 ) then
    nextLast = 1
    end if
    if ( nextLast <> first ) then
    clipboard( last ) = ActiveDocument.Selection.Text
    last = nextLast
    end if
    End Sub

    Sub ClipboardCut()
    nextLast = last + 1
    if ( nextLast > 33 ) then
    nextLast = 1
    end if
    if ( nextLast <> first ) then
    clipboard( last ) = ActiveDocument.Selection.Text
    last = nextLast
    ActiveDocument.Selection.Text = ""
    end if
    End Sub

    Sub ClipboardPaste()
    if ( first <> last ) then
    ActiveDocument.Selection = clipboard( first )
    first = first + 1
    if ( first > 33 ) then
    first = 1
    end if
    end if
    End Sub

    Sub ClipboardPasteAll()
    Do While ( first <> last )
    ActiveDocument.Selection = clipboard( first )
    first = first + 1
    if ( first > 33 ) then
    first = 1
    end if
    Loop
    End Sub

    Sub ClipboardClear()
    last = 1
    first = 1
    clipboard( 1 ) = ""
    End Sub

    Reply
  • Creative one

    Posted by Legacy on 07/17/1999 12:00am

    Originally posted by: Vinay.P.Vaidya

    I like this idea. It will be nice if it can be extended hold a list of items.

    Reply
  • Really Nice One !

    Posted by Legacy on 02/22/1999 12:00am

    Originally posted by: Bhargav Pendse


    Macros are very Easy .
    Idea is very creative.
    thanx.

    Reply
  • Thanks.

    Posted by Legacy on 02/16/1999 12:00am

    Originally posted by: Hans Wedemeyer

    Moving from MultiEdit with 26 copy/paste buffers to VC with only one
    was hard.... this help a lot.

    thank you.

    regards
    Hans Wedemeyer

    Reply
  • LIFO stacked clipboard

    Posted by Legacy on 12/06/1998 12:00am

    Originally posted by: Goran Mitrovic

    I slightly improved your second clipboard idea...
    
    


    Dim clipboard(64)
    Dim cliplines
    cliplines=-1

    Sub StackClipboardCut()
    'DESCRIPTION: Performs a cut of current selection into LIFO stack
    if(cliplines<63) then
    cliplines=cliplines+1
    clipboard(cliplines)=ActiveDocument.Selection.Text
    ActiveDocument.Selection.Text=""
    end if
    End Sub

    Sub StackClipboardCopy()
    'DESCRIPTION: Performs a copy of current selection into LIFO stack
    if(cliplines<63) then
    cliplines=cliplines+1
    clipboard(cliplines)=ActiveDocument.Selection.Text
    end if
    End Sub

    Sub StackClipboardPaste()
    'DESCRIPTION: Performs a paste of top LIFO stack entry into current selection
    if(cliplines>-1) then
    ActiveDocument.Selection=clipboard(cliplines)
    cliplines=cliplines-1
    end if
    End Sub

    Reply
  • Very useful

    Posted by Legacy on 11/25/1998 12:00am

    Originally posted by: V.Sreenivasa Rao

    This macro is very useful . Thanks a lot.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: September 10, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild". This loop of continuous delivery and continuous feedback is …

  • As mobile devices have pushed their way into the enterprise, they have brought cloud apps along with them. This app explosion means account passwords are multiplying, which exposes corporate data and leads to help desk calls from frustrated users. This paper will discover how IT can improve user productivity, gain visibility and control over SaaS and mobile apps, and stop password sprawl. Download this white paper to learn: How you can leverage your existing AD to manage app access. Key capabilities to …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds