vba中如何写打开docx文件代码
excel2007中,通过vba如何写打开docx文件代码
[最优解释]
'〓〓〓〓〓〓〓〓〓〓ExecuteSoft函数相关定义声明等 Start
Const SW_SHOWNORMAL = 1
Const SW_HIDE = 0
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'〓〓〓〓〓〓〓〓〓〓ExecuteSoft函数相关定义声明等 End
'┏〓〓〓〓〓〓〓〓〓 ExecuteSoft,start 〓〓〓〓〓〓〓〓〓┓
'[详介]:
'函数注释:
'[简介]:
'默认方式不带路径运行程序,相当于RUN
Function ExecuteSoft(Soft As String, Optional Cs As String, Optional Method As String = "Open") As Long
'[mycode_id:214],edittime:2011-8-27 下午 10:52:50
ExecuteSoft = ShellExecute(0, Method, Soft, Cs, 0, SW_SHOWNORMAL)
End Function
'┗〓〓〓〓〓〓〓〓〓 ExecuteSoft,end 〓〓〓〓〓〓〓〓〓┛
Private Sub Form_Load()
ExecuteSoft "Z:\Z盘共享\aaa.docx"
End Sub