open notepad and paste text without saving to file

J

Jesper

I know I can export data to a text file.
Is it also possible to open up notepad and paste a chunk of text into it?

Jesper
 
D

Douglas J. Steele

Not reliably. Notepad doesn't support automation. While you might be able to
cobble together code that automates keystrokes, if the user clicks anywhere
while the code is running, it won't work properly.
 
J

John Nurick

You can export to a text file and then use something like

lngRetVal = Shell("notepad.exe """ & strFileSpec & """")

to open it in Notepad.
 
J

Jesper

Not reliably. Notepad doesn't support automation. While you might be able
to cobble together code that automates keystrokes, if the user clicks
anywhere while the code is running, it won't work properly.

Thanks both of you.
 
Top