Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Jan 2006
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Controlling clipboard with VBA (word 9.0 Win2k)

    When you use copy and paste from within VBA to make a new document, you will get a message that 'a large amount of data is placed on the clipboard'. when the document is closed. This can be irritating. It is said that it is not possible to clear the clipboard from within VBA, but here is a workaround. Enjoy.

    Place this code in the document_close routine:
    Private Sub Document_Close()
    CommandBars("Clipboard").Visible = True
    CommandBars.FindControl(ID:=3634).Execute
    CommandBars("Clipboard").Visible = False
    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Controlling clipboard with VBA (word 9.0 Win2k)

    For others reading this: the Clipboard toolbar was replaced by the Clipboard task pane in Word 2002 and 2003 (don't know about 2007), so the code doesn't work there.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Wellington, New Zealand
    Posts
    143
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Controlling clipboard with VBA (word 9.0 Win2k

    For a method that should work in later versions, see http://www.mcse.ms/message1261282.html.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Controlling clipboard with VBA (word 9.0 Win2k

    The code from your link clears the Windows clipboard, but not the Office clipboard. Word 2002 and later use a special clipboard that can contain multiple items; this clipboard is unaffected by the code. It does, however, suppress the "You Copied a Large Amount of Data onto the Clipboard" dialog, so it's useful. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •