PC Review


Reply
Thread Tools Rate Thread

Can I hold the ClipBoard MetaFilePict?

 
 
Johnny H
Guest
Posts: n/a
 
      24th Aug 2005
I am trying to store the whole clipboard formats in an array so that I
can restore it later.

The MetaFilePict from WordPad and Microsoft Word is a 16 byte MemoryStream.

Why does it not work while other MemoryStreams work?



Private OldClipBoard() As DataObject
Public Sub PushClipBoard()
Dim fmts() As String = Clipboard.GetDataObject.GetFormats
Debug.WriteLine(Clipboard.GetDataObject.GetFormats)
If fmts Is Nothing Then Return
ReDim OldClipBoard(UBound(fmts))
Dim i, cnt As Integer
For i = 0 To UBound(fmts)
If Not (Clipboard.GetDataObject.GetData(fmts(i), False) Is
Nothing) Then
OldClipBoard(cnt) = New DataObject
OldClipBoard(cnt).SetData(fmts(i), False,
Clipboard.GetDataObject.GetData(fmts(i), False))
cnt += 1
Debug.WriteLine(fmts(i))
End If
Next
If cnt Then ReDim Preserve OldClipBoard(cnt - 1) Else Erase
OldClipBoard
End Sub
Public Sub PopClipBoard()
If OldClipBoard Is Nothing Then Clipboard.SetDataObject(" ") : Return
Dim i As Integer, dt As New DataObject
For i = 0 To UBound(OldClipBoard)
If OldClipBoard(i).GetFormats(False)(0) = "MetaFilePict" Then Stop
dt.SetData(OldClipBoard(i).GetFormats(False)(0), False,
OldClipBoard(i).GetData(OldClipBoard(i).GetFormats(False)(0)))
Next
Clipboard.SetDataObject(dt, True)
End Sub




Thanks for taking your time


JH

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
clipboard hold how much items raspberrytruck3 Microsoft Excel Worksheet Functions 1 3rd Apr 2009 02:20 PM
Transfer clipboard from Task pane clipboard(office?) content to Excel (windows?) clipboard? tskogstrom Microsoft Excel Programming 2 6th Mar 2007 12:50 PM
Clipboard gets empty by itself, cleared clipboard, copy paste doesn't work, outlook clears clipboard, problems with clipboard - possible solution Jens Hoerburger Microsoft Outlook 0 24th Aug 2006 02:44 PM
Suppress 'Clipboard can hold up to 12 items' message pa.singer@verizon.net Microsoft Excel Misc 0 15th Apr 2005 04:58 PM
Problems with clipboard : system.runtime.interopservices : The requested clipboard operation failed Dennis Microsoft C# .NET 0 5th Apr 2004 06:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:38 PM.