View Single Post
 
Old 03-07-2013, 03:24 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Donna,

OK, lets go through the issues one at a time:
1. Should there always a colon after SSN/SSID when it is followed by an SSN/SSID number?
2. Should there is always one space, or two spaces before the SSN/SSID number?
3. Should the space(s) between SSN/SSID and the SSN/SSID number be non-breaking, so as to ensure the SSN/SSID stays on the same line as its number number?
4. Should the hyphens within the SSN/SSID number be non-breaking, so as to ensure all parts of the SSN/SSID number stay on the same line?

At the moment, my code's answers to these questions is:
1. Yes
2. One space
3. Yes
4. Yes

If I understand what you're saying, your answers would be:
1. No. If there's a colon, leave it; if there isn't, don't add one.
2. ???
3. Yes
4. Yes

Re:
Quote:
I had to change the hyphen because it was putting in the long hyphen and I only needed the short one
The hyphen that was being inserted is the non-breaking kind. It is the same length as a normal one, but looks longer when Word is displaying formatting.

Chr(#) tell the code to use an ASCII character value. Chr(30) is a non-breaking hyphen and Chr(160) is a non-breaking space.

You asked:
Quote:
If I add an extra space inside the brackets will it do both a colon and two spaces?? That would be cleaner code-wise.
a Find expression like "SSN[: ^0160]{1,}[0-9]{9}>" will find SSN followed by at least one colon or space (breaking or non-breaking), then a 9-digit number. So, it will find 'SSN:123456789', 'SSN: 123456789', 'SSN 123456789', 'SSN 123456789', 'SSN: 123456789', etc, regardless of how many breaking or non-breaking spaces there are, provided there is at least one colon or a space between the SSN and its number.

You also asked:
Quote:
Also, where do I put the code to format the text to Arial, size 11, left-justified?
That depends on what it is you want to do that to. IMHO, though, it would be better to define a Style that way and apply the Style rather than overriding an existing Style's formatting.

As for:
Quote:
The macro runs with the track changes code commented out but if I remove the apostrophes to activate the code then it spits back this line as out of range:
...
At this point we may have gotten around the track changes but it's a matter of principal. Sometimes it will work and then other times it breaks down and I have to exit word and start fresh.
You're evidently still partially working with a previous iteration of the code and the mixing of the two versions might be behind the problem. In any event, my most recent version (above) is much 'smarter' in its processing of the dates.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote