What exactly can an array store, can arrays store text/images or just text. If it can store both how would you dimension it eg. dim blah(1 to 5) as ???

Here is the code that im having trouble with. I am making a multi-use clipboard and i want to store either an image/text from the clipboard and then paste it back... the code works now but what i had to do was create several imageboxes to store the images in because when i try to store image data in an array and try and retrieve it it says there is no data. Is there any way like a control or variable that can store both images and text?

any information or solutions would be a great help

thanks

vishal

THE CODE:

Dim Storage(1 To 5) As Variant
Dim SelectedOpt As Integer



Public Function StoreIt(i As Integer) 'Storage function

If Clipboard.GetFormat(vbCFText) = True Then
'If the clipboard contains text store it in an array
Storage(i) = Clipboard.GetText
txtStorage(i).Text = Mid$(Clipboard.GetText, 1, 20) & "..."
txtStorage(i).Enabled = False

ElseIf Clipboard.GetFormat(vbCFBitmap) = True Then
'If the clipboard contains an image store it in an imagebox
imgStorage(i).Picture = Clipboard.GetData(vbCFBitmap)
txtStorage(i) = " (picture)"
txtStorage(i).Enabled = False
Else
'If its not text or an image then the format is invalid
MsgBox "Invalid format."
End If

End Function


Public Function CopyIt(n As Integer) 'Copy to clipboard function
If txtStorage(n).Text = " (picture)" Then
'If it is a picture copy it from the image storage
Clipboard.SetData imgStorage(n).Picture, vbCFBitmap
Else
'If it is text then copy it from the text storage
Clipboard.SetText Storage(n), vbCFText
End If
End Function