Need Help with a Macro!

Joined
Nov 15, 2005
Messages
1
Reaction score
0
Hello, all! I'm creating a macro for help with some c/c++ projects, and within it, I'm trying to execute Find/Replace. Actually, it's executing fine. It's closing the prompt that I'm having a problem with. Here's a snipet of the code:

DTE.ItemOperations.OpenFile(path + sFile)
ActiveDocument.Selection.StartOfDocument()
DTE.ExecuteCommand("Edit.Find")
DTE.Windows.Item(sFile).Activate()
DTE.Find.FindWhat = functName
DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = True
DTE.Find.MatchWholeWord = True
DTE.Find.Backwards = False
DTE.Find.MatchInHiddenText = False
DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral
DTE.Find.Action = vsFindAction.vsFindActionFind
DTE.Find.Execute()
DTE.Windows.Item(Constants.vsWindowKindFindReplace).Close()

The debugger tells me that Constants is ambiguous, and it will not let me execute the macro. If I simply remove the Constants, the Find/Replace will execute, but of course, the prompt will not close because the parameter is incorrect. I'm running VS 2003. Has anyone else had this problem, and if so, is there a way to correct it? Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top