以记事本为例:
Private Sub Command1_Click()Shell "notepad", vbNormalFocusSendKeys "{enter}"End Sub
Private Sub Form_Load()Me.Hide '首先隐藏窗体,这样就不会看见Shell "cmd.exe /c C:\1.txt", vbNormalFocus '打开C盘的1.txt,同时正常大小显示并获得焦点SendKeys "{Enter}" '按下Enter键End Sub