Results 1 to 6 of 6
  • Thread Tools
  1. 2 Star Lounger
    Join Date
    Dec 2007
    Posts
    168
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi all,

    Word 2003 (+2007?)VBA: How to program the Clipboard pane

    In a VBA package I have built I needed to use Copy and Paste, which use the Word clipboard. While testing my package I then noticed that if I had performed a 'Copy command (intending to then later do a Paste) before using one of my VBA operations, then after, it is cleared from the clipboard and so no longer available for Paste. After using my VBA package ops, I would like to be able to restore the original clipboard contents.

    I have noticed that in Word 2003 there is a Clipboard pane into which I can copy as many items as I wish. Then I can select whichever one I want and paste it. This would solve the issue, but I can't find the VBA interface for accessing the items in the Clipboard pane. Can anybody tell me?

    TIA

    avi

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 13 Times in 13 Posts
    As far as I know, the Office clipboard is not accessible in the VBA object model.

    You can manipulate the Windows clipboard using the DataObject available in the Microsoft Forms 2.0 Object Library - see Windows Clipboard.

  4. 2 Star Lounger
    Join Date
    Dec 2007
    Posts
    168
    Thanks
    3
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='782457' date='30-Jun-2009 16:06']As far as I know, the Office clipboard is not accessible in the VBA object model.

    You can manipulate the Windows clipboard using the DataObject available in the Microsoft Forms 2.0 Object Library - see Windows Clipboard.[/quote]

    Can you put in the Windows clipboard all the Word formatting data information in order to copy a block of content formatted in Word?

    avi

  5. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 13 Times in 13 Posts
    No, unfortunately not, but you could use the DataObject to hold a text item while copying other items to and from the Windows clipboard (using Word's Copy and Paste methods).

  6. 2 Star Lounger
    Join Date
    Dec 2007
    Posts
    168
    Thanks
    3
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='782461' date='30-Jun-2009 16:38']No, unfortunately not, but you could use the DataObject to hold a text item while copying other items to and from the Windows clipboard (using Word's Copy and Paste methods).[/quote]

    But font names, sizes and colors ARE copied...

    But that is not the same things as Word information e.g., Style names.

  7. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 13 Times in 13 Posts
    If necessary, you could create a new Word document in code, paste there, and later on copy the contents to the clipboard again and discard the document.

Posting Permissions

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