Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21843

[RESOLVED] Is there a way to create a blank textfile?

$
0
0
Hi there everyone. I am working on a card prog for students with numbers.

I am using this code here to create a new textfile, but while I want to make a new textifle, I would like it to be blank.

I found this code on the interwebs

VB Code:
  1. Dim textFile As String
  2.  
  3. Dim textToWrite As String
  4.  
  5. textFile = App.Path & "\GeneratedCards\CardNumbersAlreadyGenerated.txt"
  6.  
  7. textToWrite = "This is Text"
  8.  
  9. Open textFile For Output As #1
  10.  
  11. Print #1, textToWrite

The only thing is I don't want to write anything in the textfile, I don't want it opened yet, just have it made for later.

If I just remove the txt to write string and print, would that still make the file correctly?

Thanks!

Viewing all articles
Browse latest Browse all 21843

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>