Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clipboard.GetText
In VB6 I can get the (text) contents of the system clipboard within my app
Debug.Print Clipboard.GetText I can't seem to do this in VBA. Is there a way to get the clipboard text into my procedures? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clipboard.GetText
Charlie,
Set a reference to the MSForms 2.0 library, and use code like the following: Dim DObj As MSForms.DataObject Dim S As String Set DObj = New MSForms.DataObject DObj.GetFromClipboard S = DObj.GetText Debug.Print S -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Charlie" wrote in message ... In VB6 I can get the (text) contents of the system clipboard within my app Debug.Print Clipboard.GetText I can't seem to do this in VBA. Is there a way to get the clipboard text into my procedures? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clipboard.GetText
"Charlie" wrote in message
... In VB6 I can get the (text) contents of the system clipboard within my app Debug.Print Clipboard.GetText I can't seem to do this in VBA. Is there a way to get the clipboard text into my procedures? Hi Charlie, It's a bit more convoluted and not as flexible, but you can do it in VBA by setting a reference to the Microsoft Forms 2.0 Object Library (which is set automatically if you add a UserForm to your project) and doing something like this: Dim objDataObject As MSForms.DataObject Set objDataObject = New MSForms.DataObject objDataObject.GetFromClipboard Debug.Print objDataObject.GetText -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Clipboard.GetText
Thanks to both of you!
"Rob Bovey" wrote: "Charlie" wrote in message ... In VB6 I can get the (text) contents of the system clipboard within my app Debug.Print Clipboard.GetText I can't seem to do this in VBA. Is there a way to get the clipboard text into my procedures? Hi Charlie, It's a bit more convoluted and not as flexible, but you can do it in VBA by setting a reference to the Microsoft Forms 2.0 Object Library (which is set automatically if you add a UserForm to your project) and doing something like this: Dim objDataObject As MSForms.DataObject Set objDataObject = New MSForms.DataObject objDataObject.GetFromClipboard Debug.Print objDataObject.GetText -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? | Setting up and Configuration of Excel | |||
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? | Setting up and Configuration of Excel | |||
Clipboard empty but still get waring that clipboard is full | Excel Discussion (Misc queries) | |||
How to GetText() from TextBox under Visual C++ application? | Excel Worksheet Functions | |||
Clipboard | New Users to Excel |