本帖最后由 作者 于 2008-2-19 9:33:17 编辑
程序里找setting.ini是在HKEY_CURRENT_USER的TDDC键值 如果setting.ini在C:\1目录下,则所以先运行 (vl-registry-write "HKEY_CURRENT_USER" "TDDC" "C:\1") 在MyOutlookBar.ctl文件中代码确定了查找setting.ini的位置: Private Sub ctxOutlookBar1_ButtonClick(ByVal oBtn As OutlookBar.cButton) If oBtn.Class = ucsBtnClassItem Then Dim sec As String sec = oBtn.Parent.Caption Dim Key As String Key = oBtn.Caption ' Dim path As String path = QueryValue(HKEY_CURRENT_USER, "TDDC", "") Dim ini As String ini = path + "\setting.ini" If Not FileExists(ini) Then MsgBox "没有找到文件setting.ini!" Exit Sub End If Dim cIniObj As New clsINI cIniObj.FileName = ini Dim val As String val = cIniObj.GetValue(sec, Key, "***") ' MsgBox val Dim mac As String mac = val + vbCr dockContainer.Application.ActiveDocument.SendCommand mac End If End Sub |