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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top