open notepad and paste text without saving to file

  • Thread starter Thread starter Jesper
  • Start date Start date
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
 
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.
 
You can export to a text file and then use something like

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

to open it in Notepad.
 
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.
 
Back
Top