check out this sample code :-
put a textbox(Text1) and a command button(Command1) on your form before u execute the following code. in the code, here "file1.txt" is the target file which i'm creating and sending different text at different time but instead of opening a new instance its closing the currently opened instance and opening a new notepad window.if u wish to modify the code,just change the name of the text file in the section where u find the term "file1.txt" and put ur filename.
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_CLOSE = &H10
Private Sub Command1_Click()
Dim winHwnd As Long, RetVal As Long
If Dir(App.Path & "\file1.txt") = "" Then
Open App.Path & "\file1.txt" For Output As #1
Print #1, Text1.Text
Close #1
Shell "notepad.exe " & App.Path & "\file1.txt", vbNormalFocus
Else
winHwnd = FindWindow(vbNullString, "file1 - Notepad")
If winHwnd <> 0 Then
RetVal = PostMessage(winHwnd, WM_CLOSE, 0&, 0&)
End If
Kill App.Path & "\file1.txt"
Open App.Path & "\file1.txt" For Output As #1
Print #1, Text1.Text
Close #1
Shell "notepad.exe " & App.Path & "\file1.txt", vbNormalFocus
End If
End Sub