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: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • CentreCorp is a fully integrated and diversified property management and real estate service company, specializing in the "shopping center" segment, and is one of the premier retail service providers in North America. Company executives travel a great deal, carrying a number of traveling laptops with critical current business data, and no easy way to back up to the network outside the office. Read this case study to learn how CentreCorp implemented a suite of business continuity services that included …

Most Popular Programming Stories

More for Developers

RSS Feeds