Click to See Complete Forum and Search --> : VB - Open notepad to read a textfile


grim_fandango
04-10-2001, 08:09 PM
i know how to use:

shell "notepad filename.txt"

but what if i want to declare the filename in a string var, how to open it using the shell command?
because i want to open a filename with a date format (ex: logfile_2001-04-10)
so i'll sth like:

Dim fileName as String
fileName = "logfile_" & Format(date, "yyyy-mm-dd")

but i dont know how to put it to the Shell command...

pls help
thx in advance

------------------
Help!!! I'm swimming with the sharks...!!

Boldy
04-10-2001, 08:19 PM
just use your filename variable in the shell statement.

Ex:
Shell fileName

grim_fandango
04-11-2001, 05:09 AM
what if i make the filename NOT in txt file?
i've tried like

Shell "notepad fileName"

but that won't work http://www.sharkyforums.com/ubb/frown.gif

------------------
Help!!! I'm swimming with the sharks...!!

Boldy
04-11-2001, 01:02 PM
Sorry, I forgot the reference to Notepad in my last post.

Try something like:
Shell "NotePad.exe " & FileName

(where FileName is a string holding your path and filename)

Make sure you get a space before the FileName. Could also write this as:
Shell "NotePad.exe" & Space(1) & FileName