Hello every one
i have a button to load two .txt files
if user select a file to load for example (test.txt)
automatically another file with the same name followed by the word first should be loaded which well be (testfirst.txt)in this case
THIS FILE SHOULD BE IN THE SAME DIRECTORY
this is my code:
VB Code:
With CommonDialog1 .CancelError = True .Filter = "Text files (*.txt)|*.txt" .DialogTitle = "Save the file..." .ShowSave If .filename <> "" Then Form1.RichTextBox1.LoadFile .filename, rtfText RichTextBox2.LoadFile Left(.filename, Len(.filename) - 4) & "first.txt", rtfText txtFileText.Text = RichTextBox2.Text End If End With
what i need is that if user selected a file that don't have a partner an error message should appaer
how can do this?
i mean if user select file test.txt and the file testfirst.txt is not there then display error message
![]()




Reply With Quote