Access开发培训
网站公告
·Access专家课堂QQ群号:151711184    ·Access快速开发平台下载地址及教程    ·欢迎加入Access专家课堂微信群!    ·如何快速搜索本站文章|示例|资料    
您的位置: 首页 > 技术文章 > Access数据库-模块/函数/VBA

通过调用regsvr32.exe自动注册控件的函数

时 间:2007-10-18 21:34:30
作 者:竹笛   ID:8  城市:上海  QQ:2851379730点击这里给张志发消息
摘 要:通过调用regsvr32.exe自动注册控件的函数
正 文:

通过调用regsvr32.exe自动注册控件的函数
来源:access911.net

Function RegOCX(BeReg As String)
Dim RegFile1 As String
Dim RegFile2 As String
Dim RetVal
RegFile1 = Environ("windir") & "\system\regsvr32.exe "
RegFile2 = Environ("windir") & "\system32\regsvr32.exe "
If Dir(RegFile1) <> "" or Dir(RegFile2) <> "" Then
If Dir(RegFile1) <> "" Then
RegFile1 = RegFile1 & "/s" & BeReg
RetVal = Shell(RegFile1, 1)
Else
RegFile2 = RegFile2 & "/s" & BeReg
RetVal = Shell(RegFile2, 1)
End If
Else
MsgBox "找不到regsvr32.exe文件,无法完成自动注册,您需要手动注册" & BeReg & "这个控件", vbCritical, "无法自动注册控件"
End If
End Function


Access软件网官方交流QQ群 (群号:483923997)       Access源码网店

常见问答:

技术分类:

相关资源:

专栏作家

关于我们 | 服务条款 | 在线投稿 | 友情链接 | 网站统计 | 网站帮助