Hi Richard,
>Is there a way to do this using the RegEx bit of the Find
>and Replace dialog?
You can use the following RegEx to match all the comment in the Visual
Studio's Find what field:
'.+$
but I am afraid the Replace filed does not support RegEx, so you could not
use the RegEx to replace those commnets in Visual Studio.
>Or would this have to be done using a Macro?
yes, based on my test, the following Macro code could change all the
characters of the current active document's comments text to lowercase:
Public Sub FindAndReplace()
Dim objTextDoc As TextDocument
Dim objEditPt As EditPoint, iCtr As Integer
objTextDoc = DTE.ActiveDocument.Object("TextDocument")
objEditPt = objTextDoc.StartPoint.CreateEditPoint
While (objEditPt.FindPattern("'.+$",
vsFindOptions.vsFindOptionsRegularExpression) = True And
objEditPt.AtEndOfDocument <> True)
objEditPt.ChangeCase((objEditPt.LineLength -
objEditPt.LineCharOffset) + 1, vsCaseOptions.vsCaseOptionsLowercase)
objEditPt.LineDown()
End While
End Sub
Whish this helps!
Best regards,
Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
======================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
Richard Bysouth - 16 Feb 2006 08:23 GMT
Gary
thanks for the quick response - yes that works fine for me.
I think i'll modify it to loop through the entire project at some point.
Haven't really used VS macros before but think I will have to now - very
useful!
Richard
"Gary Chang[MSFT]" - 16 Feb 2006 09:06 GMT
Hi Richard,
I am glad to know it helps, good luck.:)
Thanks!
Best regards,
Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006. Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
======================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================