Open a file with notepad through VBA

前端 未结 5 618
一向
一向 2020-12-19 23:39

I am trying to open a file with notepad.

const strfilename = \"C:\\Users\\Desktop\\abc.txt\"

set OFS = myOFSO.OpenTextFile(strfilename) 

I

5条回答
  •  攒了一身酷
    2020-12-20 00:08

    Could just call a shell command to execute notepad.exe with the file path.

    returnvalue = Shell("notepad.exe " & strfilename, vbNormalFocus)
    

提交回复
热议问题