好的……给你 ;使用Duh';s的WshShell思想(您需要添加一个引用)和VLAX。此处为cls';这就是我想到的 ;附件中包含了您需要的所有内容- Option Explicit
- Public strPlotStampLocale As String
- Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
- Dim oWsh As WshShell
- GetPlotStampLocation
- Select Case UCase(CommandName)
- Case Is = "PUBLISH"
- Set oWsh = New WshShell
- oWsh.RegWrite strPlotStampLocale, "1", "REG_DWORD"
- Set oWsh = Nothing
- Case Is = "PLOT"
- Set oWsh = New WshShell
- oWsh.RegWrite strPlotStampLocale, "1", "REG_DWORD"
- Set oWsh = Nothing
- End Select
- End Sub
- Private Sub GetPlotStampLocation()
- Dim obj As VLAX
- Dim Key As String
- Dim Prof As String
-
- Set obj = New VLAX
- Key = obj.EvalLispExpression("(vlax-product-key)")
- Prof = obj.EvalLispExpression("(getvar ""cprofile"")")
-
- strPlotStampLocale = "HKEY_CURRENT_USER" & Key & "\Profiles" & Prof & "\Dialogs\Plot Stamp\PlotStamp"
- End Sub
|