To put text in the clipboard, use code like
Private Sub CommandButton1_Click()
Dim DataObj As MSForms.DataObject
Set DataObj = New MSForms.DataObject
DataObj.SetText Me.TextBox1.Text
DataObj.PutInClipboard
End Sub
--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
"robs3131" <(E-Mail Removed)> wrote in message
news:BF515601-6E9C-49AD-8803-(E-Mail Removed)...
> Hi all,
>
> I'm having two more issues with my form:
>
> 1 - I would like to have a command button on the form copy the text within
> a
> text box on the form so that the user can then paste it into Notepad or
> Word
> (and so that only the text is copied, not the formatting lines of code
> such
> as "& vbnewline & _"). My code below is not working.
>
> 2 - I have set the "Scrollbars" attribute of the text box within the form
> to
> "2 - frmScrollBarsVertical" -- the issue is that it doesn't appear until
> the
> user actually clicks within the text box. I'd like it to appear as soon
> as
> the code is executed. I noticed that a text box doesn't have the
> "KppeScrollBarsVisible" attribute that a form does...
>
> Thanks for your help!
>
> Below is the code that executes when the commandbutton within the form is
> clicked -- I get a "Compile Error: Invalid Qualifier" error:
>
> Private Sub cmdcopymsg_Click()
>
> With frmerrormsg
> .txterrormsg.Text.Copy
> End With
>
> End Sub
>
>
> --
> Robert