Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto-numbering Macro in Word 2003 1

Status
Not open for further replies.

colinmitton

Technical User
Feb 24, 2005
190
GB
I have written (recorded then edited!) a macro in Word 2003 to setup a selected area of text with our own autonumber style. This works fine, the only tweak I want to add is where the is a line that has only a carridge return and no text for it either to skip and not number or to just delete and let the numbering continue.

At current the autonumbering gives the line a number (with out text) and goes to the next line (with text) and continues on... this means they then have to manual check the document and remove the numbers.

I did not know if there was a bit of VBA that could find blank lines and delete them before I ran the autonumbering macro? or if there was a way of skipping blank lines during the autonumbering?

I could be posting this in the wrong forum to which I appologies in advance.

Thanks
 


You want to look for adjacent pararagraphs.

Use the Edit > Replace and search for ^p^p, replace with ^p.

Skip,

[glasses]Just traded in my old subtlety...
for a brand NUANCE![tongue]
 
where the is a line that has only a carridge return and no text"

Better yet...do not have any of those.

Those "empty" paragraphs are used to make space between paragraphs. If you used Styles fully, that space can be part of the Style, and there would be no need to have ANY lines with "only a carridge return and no text".

faq219-2884

Gerry
My paintings and sculpture
 
The documents in question are downloaded from a internet supplier! one of previous questions I possed was about styles and adjusting them and that part is now sorted!

So thankfully my macro(s) ensures the Paper / Styles / autonumbering are correct to our standard and the annouying carridge returns are removed!

My only issue left is that on some lines the start with a space then text! I'm trying to sort that one out so any suggestions are welcome!
 



replace [paragraph][space]
[tt][highlight]
^p [/highlight]
[/tt]
with [paragraph] no space
[tt]
[highlight]^p[/highlight]
[/tt]


Skip,

[glasses]Just traded in my old subtlety...
for a brand NUANCE![tongue]
 
Why oh why did I not think of that :)

I spent an age looking for a special character for space!

Thanks again Skip it works like a dream. Sometime the most obivous thing to do you look straight past!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top