PaulBarter
MIS
I have written a Word macro, part of which checks all the paragraphs in my document, and then if the first character is a tab it deletes that tab.
The problem is that if the next character is a smart quote or smart apostrophe then Word is automatically inserting a space when I delete the tab. Normal quotes and apostrophes work ok.
i.e. a paragraph containing
(tab)'xxx
when I delete the tab gives
'xxx
as required
but if the paragraph contains then
(tab)(smart open apostrophe)xxx
when I delete the tab becomes
(space)(smart open apostrophe)xxx
Smart quotes give the same problem.
The code I am using (much simplified but still giving the same problem) is:
Any ideas on how to stop Word doing this?
The problem is that if the next character is a smart quote or smart apostrophe then Word is automatically inserting a space when I delete the tab. Normal quotes and apostrophes work ok.
i.e. a paragraph containing
(tab)'xxx
when I delete the tab gives
'xxx
as required
but if the paragraph contains then
(tab)(smart open apostrophe)xxx
when I delete the tab becomes
(space)(smart open apostrophe)xxx
Smart quotes give the same problem.
The code I am using (much simplified but still giving the same problem) is:
Code:
Sub DelTab()
Dim intI As Integer
For intI = 1 To ActiveDocument.Paragraphs.Count
If ActiveDocument.Paragraphs(intI).Range.Characters(1).Text = vbTab Then
ActiveDocument.Paragraphs(intI).Range.Characters(1).Delete
End If
Next
End Sub
Any ideas on how to stop Word doing this?