Thread: [Solved] Macro help
View Single Post
 
Old 03-01-2012, 07:53 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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 redzan,

Thanks for the feedback.

One unusual thing about the macro is that is has these two lines:
.Execute Replace:=wdReplaceAll
.Execute
Ordinarily, you might not use the first one. In this case, however, I decided to do so on the premise that most of the converted paragraphs would have no more than a single space. If none has more than a single field with a space, the loop following the second line will never execute. However, if the initial reformatting gives something like:
###CHEST,BOZO, THE, CLOWN,02/27/2012,123456,WILL, SMITH,ADC
the first pass won't be sufficient and the loop will execute. It's more efficient this way and could make a noticeable difference in a really large document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote