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!
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!