I'm using vba6 with quattro pro
and am new to visual basic. I'd like
to copy the contents of a listbox
(or combobox) to the clipboard but
just cant figure it out.
Help or suggestions would be appreciated.
Thanks,
Doug Anderson
Printable View
I'm using vba6 with quattro pro
and am new to visual basic. I'd like
to copy the contents of a listbox
(or combobox) to the clipboard but
just cant figure it out.
Help or suggestions would be appreciated.
Thanks,
Doug Anderson
To add it to the clipboard you could use this code:
HTHCode:Option Explicit
Dim I As Integer
Private Sub Command1_Click()
For I = 1 To List1.ListCount
If I = 1 Then
'//you can command this out
'//without this line VB adds an extra empty line to the Clipboard
Clipboard.SetText List1.List(I - 1)
Else
Clipboard.SetText (Clipboard.GetText & vbCrLf & List1.List(I - 1))
End If
Next I
End Sub
------------------
Visual Basic Programmer
------------------
PolComSoft
You will hear a lot about it.