Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Sub ExampleGetData()
  2.  
  3. Dim Data As DataObject
  4. Set Data = New DataObject
  5. Data.GetFromClipboard
  6. MsgBox Data.GetText(x)
  7. End Sub
  8.  
  9. Dim MyData as DataObject
  10.  
  11. Private Sub CommandButton1_Click()
  12. 'Need to select text before copying it to Clipboard
  13. TextBox1.SelStart = 0
  14. TextBox1.SelLength = TextBox1.TextLength
  15. TextBox1.Copy
  16.  
  17. MyData.GetFromClipboard
  18. TextBox2.Text = MyData.GetText(1)
  19. End Sub
  20.  
  21. Private Sub UserForm_Initialize()
  22. Set MyData = New DataObject
  23. TextBox1.Text = "Move this data to the " _
  24. & "Clipboard, to a DataObject, then to "
  25. & "TextBox2!"
  26. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement