View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charlie Charlie is offline
external usenet poster
 
Posts: 703
Default Copying more than 255 Characters to the Clipboard

' 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)


"biker" wrote:

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.