Copying more than 255 Characters to the Clipboard

G

Guest

I am trying to copy from a string (variable) more than 255 characters to the
clipboard, however, it keeps getting cut off. I am using the procedures from
www.cpearson.com/excel/clipboar.htm

For example, PutOnClipboard (text)

Is there anyway to get all of the string to go onto the clipboard so when I
paste into email/word all characters are there?

Any help would be much appreciated.
 
G

Guest

' requires "Microsoft Forms 2.0 Object Library" (which is automatically
' added to the VBE references whenever a control such as a command button
' is attached to a worksheet)

Dim objDataObject As New DataObject
Dim ClipboardText As String

objDataObject.GetFromClipboard
ClipboardText = objDataObject.GetText(1)
Debug.Print Len(ClipboardText)
objDataObject.Clear
objDataObject.SetText Space(123456)
objDataObject.PutInClipboard
ClipboardText = objDataObject.GetText(1)
Debug.Print Len(ClipboardText)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top