Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using a custom format on the clipboard
I want to put some data on the clipboard and retreive it but using a custom
format. I tried the code below. I run myCopy and it works fine but myPaste fails when trying to retreive the data (myStr = myDataObj.GetText("myFormat")) with the error message: Dataobject: Gettext invalid FORMATETC structure. Can someone help me make this work. I want to use a custom format because I also want to keep some standard text data in the clipboard. Thanks Fred Sub myCopy() Dim myDataObj As DataObject Set myDataObj = New DataObject myDataObj.SetText Selection.Cells(1).Value, "myFormat" myDataObj.PutInClipboard Set myDataObj = Nothing End Sub Sub myPaste() Dim myStr As String Dim myDataObj As DataObject Set myDataObj = New DataObject myDataObj.GetFromClipboard myStr = myDataObj.GetText("myFormat") MsgBox myStr Set myDataObj = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
clipboard and format painter | Excel Discussion (Misc queries) | |||
Format Cell as custom type but data doesn't display like I custom. | Excel Discussion (Misc queries) | |||
Custom face on a button without using clipboard? | Excel Programming | |||
Custom face on a button without clipboard? | Excel Programming | |||
Custom button face without clipboard? | Excel Programming |