Office中国论坛/Access中国论坛

标题: 请高赐教!谢谢 [打印本页]

作者: jennywu    时间: 2005-7-28 21:47
标题: 请高赐教!谢谢
如何用Access里的commandButton按钮打开编辑过的Word文档!


作者: zhengjialon    时间: 2005-7-28 22:00
commandButton的单击事件过程中写代码,但要用API:

用API函数



在模块头写声明:

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



单击事件使用:

Call ShellExecute(hwnd, "open",myPath & "f:\2.DOC" , vbNullString, vbNullString, 1)



[此贴子已经被作者于2005-7-28 14:11:21编辑过]


作者: jennywu    时间: 2005-8-8 22:10
如果用Access的语言如何写?
作者: LucasLynn    时间: 2005-8-8 22:44
按钮向导里面好像直接有这个功能吧。
作者: wu8313    时间: 2005-8-9 03:39
以下是引用zhengjialon在2005-7-28 14:00:00的发言:



commandButton的单击事件过程中写代码,但要用API:

用API函数



在模块头写声明:

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



单击事件使用:

Call ShellExecute(hwnd, "open",myPath & "f:\2.DOC" , vbNullString, vbNullString, 1)



请问郑家龙先生:

是否需要写一段代码来判断word是否已经安装?然后再使用您的代码.




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3