How can I insert curly quotes in my IDE as direct quotes?

How can I insert curly quotes in my IDE as direct quotes? I often embed code in Visual Studio from PDF files. Then I have to change all the quotes to โ€œdirectโ€. Ive tried programs that share formatting, but they do not work. Below is an example of what I mean.

alt text

thanks

+4
source share
2 answers

You can write an add-in to do this, but for quick and easy I did this with this macro and added a button to the toolbar to launch it:

Imports EnvDTE Public Module Module1 Sub RemoveSmartQuotes() Dim sFind() As String = New String() {Chr(145), Chr(146), Chr(147), Chr(148)} Dim sReplace() As String = New String() {Chr(39), Chr(39), Chr(34), Chr(34)} For i As Integer = 0 To sFind.Length - 1 DTE.Find.Action = vsFindAction.vsFindActionReplaceAll DTE.Find.FindWhat = sFind(i) DTE.Find.ReplaceWith = sReplace(i) DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument DTE.Find.MatchCase = False DTE.Find.MatchWholeWord = False DTE.Find.MatchInHiddenText = True DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral DTE.Find.KeepModifiedDocumentsOpen = False DTE.Find.FilesOfType = "" DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone DTE.Find.Execute() Next i End Sub End Module 
+5
source

Not perfect, but when I have this problem (if you paste large chunks of text?), I paste into notepad (or notepad ++) and do a search - replace.

+3
source

All Articles