Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default Putting plain text string into clipboard in VBA?

Our pricing program produces a quote letter on a worksheet. All text is in
Column A. Right now I have a button that puts Column A into the clipboard,
then the user pastes it into Notes. The problem is Notes considers this a
picture, so the user has to select Paste Special - Text from the menu to
paste in. Now the macro behind the button could easily turn the text in
Column A into a delimited text string. But then how would my VBA code put
that string into the clipboard?

Don <www.donwiss.com (e-mail link at home page bottom).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Putting plain text string into clipboard in VBA?

Look at Chip Pearson's site:

http://www.cpearson.com/excel/clipboar.htm

--

Vasant



"Don Wiss" wrote in message
...
Our pricing program produces a quote letter on a worksheet. All text is in
Column A. Right now I have a button that puts Column A into the clipboard,
then the user pastes it into Notes. The problem is Notes considers this a
picture, so the user has to select Paste Special - Text from the menu to
paste in. Now the macro behind the button could easily turn the text in
Column A into a delimited text string. But then how would my VBA code put
that string into the clipboard?

Don <www.donwiss.com (e-mail link at home page bottom).



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default Putting plain text string into clipboard in VBA?

On Sat, 21 May 2005, "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote:

Don Wiss wrote:
Now the macro behind the button could easily turn the text in
Column A into a delimited text string. But then how would my VBA code put
that string into the clipboard?


Look at Chip Pearson's site:

http://www.cpearson.com/excel/clipboar.htm


Wonderful. Works like a charm. Now do you have any ideas for giving the
user a visual indication that the text is in the clipboard? When putting
the worksheet range in you have those flashing dashed lines around the
text. With this there will be no visual indication.

Don <www.donwiss.com (e-mail link at home page bottom).
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Putting plain text string into clipboard in VBA?

Sorry, no brilliant ideas. Perhaps a MessageBox?

MsgBox "The data is now in the Clipboard and is ready to be pasted into
Notes.", vbOKOnly

--

Vasant



"Don Wiss" wrote in message
...
On Sat, 21 May 2005, "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote:

Don Wiss wrote:
Now the macro behind the button could easily turn the text in
Column A into a delimited text string. But then how would my VBA code

put
that string into the clipboard?


Look at Chip Pearson's site:

http://www.cpearson.com/excel/clipboar.htm


Wonderful. Works like a charm. Now do you have any ideas for giving the
user a visual indication that the text is in the clipboard? When putting
the worksheet range in you have those flashing dashed lines around the
text. With this there will be no visual indication.

Don <www.donwiss.com (e-mail link at home page bottom).



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Putting plain text string into clipboard in VBA?

you could do it via api's but msforms has a databoejct
you could use for this.

make sure you have a reference to msforms in your project

Sub Foo()
Dim s As String
Dim c As Range
Dim cb As MSForms.DataObject
Const DL = ";"

For Each c In Range("a1:a12")
s = s & DL & CStr(c)
Next

Set cb = New DataObject
cb.SetText Mid(s, 2)
cb.PutInClipboard
Set cb = Nothing

End Sub




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Don Wiss wrote :

Our pricing program produces a quote letter on a worksheet. All text
is in Column A. Right now I have a button that puts Column A into the
clipboard, then the user pastes it into Notes. The problem is Notes
considers this a picture, so the user has to select Paste Special -
Text from the menu to paste in. Now the macro behind the button could
easily turn the text in Column A into a delimited text string. But
then how would my VBA code put that string into the clipboard?

Don <www.donwiss.com (e-mail link at home page bottom).

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlinks in plain text? Robin Chapple[_3_] Excel Discussion (Misc queries) 1 September 5th 07 11:00 AM
putting a string from one cell in the formula of another -- indirect needed? [email protected] Excel Worksheet Functions 3 January 23rd 06 07:55 PM
Hyperlink from plain text. B.C.Lioness Excel Discussion (Misc queries) 2 May 3rd 05 04:10 PM
Need to turn off prompt about putting on clipboard or not... KyWilde Excel Discussion (Misc queries) 0 April 27th 05 11:37 PM
Putting an image into the clipboard Jonathan Crow Excel Programming 2 September 12th 03 12:06 AM


All times are GMT +1. The time now is 02:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"