Link to home
Start Free TrialLog in
Avatar of jennifere
jennifere

asked on

Sending text to notepad

I want to make a delimited file and send the results to notepad.  Each record needs to be displayed on a new line.  Is there an easy way to do this?
Avatar of swdld
swdld

Hi,
1) write your logs into a local file like 'C:\try.txt'
2) start the file in notepad with
   'shell notepad C:\try.txt'
3) Notepad will start with the file shown which contains your logs

Note: Writing new logs into the file while notepad shows the file will not make any 'updates' within notepad. For having dynamic overview on your logs use a listbox or something like this.

C.U.,
swdld
Why don't you store the items you want to send to notepad in variables, then try:

Public strStored As String

Private Sub Command1_Click()
strStored = "Put the information from your delimited file here"
Open "C:\Notepad.txt" For Append As #1
Write #1, strStored
Close #1
End Sub
Avatar of jennifere

ASKER

I am sending a lot of data to notepad.  This data is stored in a collection and is going to to executed in a for loop, therefore, - I'm assuming here, re-opening and closing the file may be slow.  I tryed using Shell to open Notepad.  Notepad opens okay, but I am unsure how to write my data to it.....
ASKER CERTIFIED SOLUTION
Avatar of TooKoolKris
TooKoolKris

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks TooKoolKris.  That works!   =)
Avatar of Richie_Simonetti
Is it necesary to use notepad? Why don't you simply append lines to a text box control.
If not, EDDY has an excelent workaround with that link.
TooKoolKris, i don't see how it would be useful, there is no code to "update" notepad there.
Well I guess it's not very important to see why it would be useful to you it's jennifere who needs to use it. When she adds this to here loop statement it will append the current .txt file with a new line for each record. Notepad is not needed. The only thing that need to be updated(appended) is the text file.
Rich,


May be I mis-read the question.

?8->