好的...给你。使用Duh对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
|