Re: Can't SetText to Clipboard
From: Bob Butler (tiredofit_at_nospam.com)
Date: 05/17/04
- Next message: Peter Bobrowski: "Re: bug (combo box)"
- Previous message: Rob Janssen: "Re: VB6 SP6 problem with SQL 2000 Enterprise Manager"
- In reply to: WangYK: "Can't SetText to Clipboard"
- Next in thread: Lucvdv: "Re: Can't SetText to Clipboard"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 17 May 2004 06:00:53 -0700
"WangYK" <WangYK@Telkom.NET> wrote in message
news:uW1F5Y9OEHA.2960@TK2MSFTNGP10.phx.gbl
> Why is it I can't get text to Clipboard when the Clipboard has already
> contained text?
>
> Situation simulation:
> Open IE,
> copy a text on HTML page, (i.e.:ABC)
That copies HTML-formatted text to the clipboard as well as plain text
> at VB, I code :
>
> Private Sub cmdCopy_Click()
> Clipboard.SetText cmdCopy.Caption, vbCFText '(i.e.:the caption is set
> to DEF)
> Clipboard.SetText cmdCopy.Caption, vbCFRTF
> End Sub
You overwrote the plain text and any RTF text (on't know offhand if IE put
any there or not)
> Then I go to "Start Menu|Run" of Windows, right click, Paste
> viola the caption "DEF" is pasted,
The run box is looking just for plain text so you get the last thing written
> but when I go to some a web page textbox and paste it there
> the pasted text is "ABC"
Right, the web browser looks for HTML text first and finds the info that IE
put there originally. Open Word and use Edit / Paste Special and you can
select the various formats available to see what each holds.
> Is this bug?
No, it's "by design"
> How to solve such situation?
Use "Clipboard.Clear" in your VB app to remove anything already there (in
which case the web browser will find no HTML text so will look for other
formats) or find a way to put HTML-formatted text on the clipboard.
-- Reply to the group so all can participate VB.Net... just say "No"
- Next message: Peter Bobrowski: "Re: bug (combo box)"
- Previous message: Rob Janssen: "Re: VB6 SP6 problem with SQL 2000 Enterprise Manager"
- In reply to: WangYK: "Can't SetText to Clipboard"
- Next in thread: Lucvdv: "Re: Can't SetText to Clipboard"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|