Sub t1()Dim txt txt = Shell("notepad E:\test\123.txt", vbNormalFocus) SendKeys "abcd{enter}efg" AppActivate txt, TrueEnd Sub