打开Word文件

dwh0722 2003-03-30 09:09:17
怎么打开一个现有的test1.doc,我要的是内容显示在word中,就象双击 test1.doc 一样。
我用open 或FileSystemObject.OpenTextfile 好象不行
请用代码告之
...全文
50 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
northwolves 2003-03-30
  • 打赏
  • 举报
回复
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
Sub opendoc(ByVal dirpath As String)
ShellExecute hwnd, "open", dirpath, vbNullString, vbNullString, 5
End Sub
Private Sub Command1_Click()
Call opendoc("c:\test1.doc")
End Sub

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧