Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a notepad silently 2

Status
Not open for further replies.

jmc014

Technical User
Nov 24, 2007
80
ES
Hi,

Is it possible to create a notepad without being asked to create one case the file does not exist?

The below function that I've been using constantly asks the user if he/she wants to create a new notepad
in the case of non existence.

Shell "C:\WINDOWS\Notepad.exe Myresults", vbNormalFocus

The idea that I have is to create a notepad, paste some reslts from my main form (via: SendKeys "^v") and then save the file without
asking the user anything.

If it's of any help, I'm wotking with Access2007 / Win10.

Thanks guys,


 
If you just want to create a text file (Notepad is just one way to create/display text files anyway) you can just do:

Code:
Open "C:\Temp\MyTextFile.txt" For Output As #1
Print #1, "Some text"
Close #1

And your user will never see anything. No Notepad required.

Would that work for you?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Excellet Andy, thanks...Got it working a treat.
There goes a star for that one mate..

JMC,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top