For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > January 2006 > performing a search, jumping to a location in a visual studio macro









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author performing a search, jumping to a location in a visual studio macro
tbh

2006-01-18, 7:58 am

i'd like to record a macro to perform a search and jump to the location of
the first hit.

unfortunately, my macro breaks at the step "jump to the location of the
first hit":
- i can record the steps to search and jump to the first occurrence (and it
works while I'm recording), but
- when i play it back i get an error

editing the macro i find two lines having to do with "jump to the first
search hit":
DTE.Windows.Item(Constants.vsWindowKindFindResults1).Activate

DTE.ExecuteCommand("Edit.GoToFindResults1Location")

the second line is the one that yields the error. if i comment it out I get
no error (but of course I also don't jump to the location I need to jump
to.)

the error is
Error HRESULT E_FAIL has been returned from a call to a COM component.

i'd be grateful for pointers to get me past this hurdle.

cheers,

Tim Hanson





tbh

2006-01-20, 7:59 am

it would be great to find out if this bug can be fixed or worked around, so
I'm re-posting with a copy to msdn.general

cheers,

Tim Hanson

"tbh" <femdev@newsgroups.nospam> wrote in message
news:uFnaHBCHGHA.2472@TK2MSFTNGP10.phx.gbl...
> i'd like to record a macro to perform a search and jump to the location of
> the first hit.
>
> unfortunately, my macro breaks at the step "jump to the location of the
> first hit":
> - i can record the steps to search and jump to the first occurrence (and
> it works while I'm recording), but
> - when i play it back i get an error
>
> editing the macro i find two lines having to do with "jump to the first
> search hit":
> DTE.Windows.Item(Constants.vsWindowKindFindResults1).Activate
>
> DTE.ExecuteCommand("Edit.GoToFindResults1Location")
>
> the second line is the one that yields the error. if i comment it out I
> get no error (but of course I also don't jump to the location I need to
> jump to.)
>
> the error is
> Error HRESULT E_FAIL has been returned from a call to a COM component.
>
> i'd be grateful for pointers to get me past this hurdle.
>
> cheers,
>
> Tim Hanson
>
>
>
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com