Can I save the contents of the clipboard as a .txt file, or do I need to
open Notepad, paste the contents in, and then save it? Can anyone tell me
how to do this? Thanks.

Re: Can I save clipboard contents as .txt file? by Charles

Charles
Mon Sep 27 19:53:28 CDT 2004

Here's some code that will do that....




Sub OutputClipboardToText()

Dim txt As Shape
Dim sFileName As String
Dim iOutput As Integer

Set txt =
ActiveDocument.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal,
Left:=10, Top:=10, Width:=100, Height:=200)

txt.TextFrame.TextRange.PasteAndFormat (wdFormatPlainText)

sFileName = "Clipboard.txt"
Open sFileName For Output As #1
Print #1, txt.TextFrame.TextRange.Text
Close

txt.Delete


End Sub


--
Charles
www.officezealot.com
"Dave B" <davidbarbetta@hotmail.com> wrote in message
news:ea$mYAPpEHA.556@TK2MSFTNGP09.phx.gbl...
> Can I save the contents of the clipboard as a .txt file, or do I need to
> open Notepad, paste the contents in, and then save it? Can anyone tell me
> how to do this? Thanks.
>
>