Thanks.
I have decided to do it a different way though. I am now using a Tree view to list all files in the directory. It allows a much better interface for what I am trying to accomplish.
I do have a new problem though. The main function of the form (frmNewTemplate) is to open a file an put the contents into a rich textbox on the main form (frmMain) but it doesn't seem to be working. If I put a RichTextBox on the frmNewTemplate it is able to open the file and put it into the RichTextBox correctly but when I change it to be placed into the frmMain it doesn't update the RichTextBox.
Do have any ideas on how to pass the information from frmNewTemplate to frmMain?
I have included the code below. Again it works until the part of updating frmMain.
Code:
OpenPath = App.Path & "\templates\"
OpenFileWName = TreeView1.SelectedItem
If OpenFileWName = OpenPath Then
MsgBox "You can not select a directory. Please select a template file."
Else
Open OpenPath & OpenFileWName For Input As #1
Do Until EOF(1)
Line Input #1, lineoftext$
If frmMain.RichTextBox1.Text = "" Then
alltext$ = lineoftext$
Else
alltext$ = alltext$ & vbCrLf & lineoftext$
End If
frmMain.RichTextBox1.Text = alltext$
Loop
Close #1
'Unload Me
End If
Thank you in advance for any help that you or anyone else may provide.
Joel Strellner