First of all and before I forget, I hope everyone has a great Christmas and a terrific and healthy new year!
My problem this time is with quotes and presenting code in a word document.
In a new document type 'Comment.
I'm pretty sure the quote will alter to something like a tiny forward slash. That is, the top is to the right of the bottom.
If I select that statement and run...
Code: Select all
Sub subString()
Dim slStr As String
Dim lnglN As Long
slStr = Selection.Text
Debug.Print slStr
For lnglN = 1 To Len(slStr)
Debug.Print Asc(Mid$(slStr, lnglN, 1)), Chr$(Asc(Mid$(slStr, lnglN, 1)))
Next lnglN
' *********************************************************************
End Sub
‘Comment
145 ‘
67 C
111 o
109 m
109 m
101 e
110 n
116 t
13
It doesn't show "correctly" here because of the conversion occurring, but the chr(145) is like a tiny *backward* slash in the immediate window!
It's so strange because If I copy and paste the line 'Comment from word to my editor of choice, notepad++, the comment character comes out as the little backward slahs.
If I copy and paste into Notepad it comes out the other way around!
This means that It's not possible to copy/paste into an editor to set the quote to an ordinary one.
I thought I had all this licked years ago!
I feel I'm totally out of my depth now.
I've googled change smart quotes for a couple of hours now and none of the code I've tried from the net hasn't worked to alter smart quotes to ordinary ones.
We need to present code in word that is copy and pasteable straight into the VBE.
Can anyone help please?
TIA
Lisa