views:

327

answers:

2

I've been trying to write a macro do do the equivalent of

  1. Hitting Ctrl+Alt+E to bring up the Exceptions window
  2. Toggling the textbox in the 'thrown' column for 'Common Language Runtime Exceptions'
  3. Hitting OK

If I record this, it records only a single line of macro code which doesn't do anything. Anyone know how to do this?

A: 

It's late and I haven't tested it, but does this help?

    Dim dbg As EnvDTE90.Debugger3 = DTE.Debugger
    Dim exSettings As EnvDTE90.ExceptionSettings = dbg.ExceptionGroups.Item("Common Language Runtime Exceptions")
    Dim exSetting As EnvDTE90.ExceptionSetting = exSettings.Item("System.Data")

    If exSetting.BreakWhenThrown Then
        exSettings.SetBreakWhenThrown(False, exSetting)
    Else
        exSettings.SetBreakWhenThrown(True, exSetting)
    End If
Martin
It almost works. With a bit of tinkering I'm sure it would. ta!
mcintyre321
A: 

A similar question was posted and answered here. It works for all CLR exceptions and takes ~1.5s to execute.

Marcel Gosselin
thanks. man i wish i'd got 12 upvotes!
mcintyre321