PDA

View Full Version : autonumber within tables?



nat1
05-02-2008, 10:19 AM
Hello,

Is there a way either with a word function or programmatically to autonumber sequentially in word tables? I have imported an HTML file into word but have removed some of the rows and now the numbering obviously is messed up.

The problem is there are around 70 pages and I would like a quick and easy solution, if there is one?. The numbering format is 1, 1.1, 1.2....etc, 2, 2.1 and so on.

Any help or guidance would be greatly appreciated. This project is on-going and not a one off. The process of importing HTML files into word is likely to be on a monthly basis.

Thank-you

fumei
05-02-2008, 11:23 AM
"The process of importing HTML files into word is likely to be on a monthly basis."

I am sorry to hear that. IMO Word and HTML files should never meet.

However, more details are needed. What is the situation regarding Styles?

nat1
05-02-2008, 12:23 PM
The style for the numbering is as follows: Style Arial 9 pt Bold Left: 0.63 cm. The table is 2 columns with the leftmost being the number. If you need any further information I will do my best to supply.

Thanks for replying and offering help.

fumei
05-02-2008, 05:01 PM
If the Style is:

Arial 9 pt Bold Left: 0.63 cm

then it is NOT a proper use of styles. Which is what I suspected. Styles are, in fact, not being used.

Use a numbered style.

nat1
05-04-2008, 03:41 AM
Ok thanks for your help. I have now worked out how to renumber. I went into styles and formatting, selected only the leftmost column which is housing the numbers and selected bullets and numbering. I was then able to renumber using the appropiate format, although I had to restart the numbering at 2, 3 etc. Not a big problem but it does slow things down somewhat.

Is there a way to do this with code or am I stuck with the method I am using?

Thanks once again for your help.

fumei
05-05-2008, 06:04 AM
1. why is code required?

2. it sounds like you are still not using Styles.

nat1
05-05-2008, 10:06 AM
Sorry I'm not very familiar with Word. I thought I was using a style as indicated in my last post. I'm assuming that I'm not judging by your last post. Is the method I explained above to renumber wrong?

Sorry for my ignorance.

fumei
05-05-2008, 10:55 AM
No it is not wrong, but it sounds like you are doing it manually.

nat1
05-05-2008, 12:11 PM
Yes I am doing this manually in the sense that the imported html files do not have any style applied to them for autonumbering.

I was just wondering if it was possible with vba to renumber? If not then it doesn't really matter, it's just a pain to initially set the style. As previously mentioned when setting the style I have to restart the numbering at 2, 3 , 4 etc, so that I end up with outline numbering.

Thanks for your help, I do appreciate it.

fumei
05-05-2008, 12:55 PM
Well you have not given the details, so it is hard to say.

Is it all one table?

Can you simply select the column and set the style explicitly? In which, it would not matter how many rows you took out ( or added), it would always be correct.

You say you restart numbering. That is nice, but you do mention, at all, WHERE you do this. For each row? For each new table - if there are separate tables, which you do not state.

If you use styles fully, you should NOT have to do any manually...well anything.

nat1
05-05-2008, 01:10 PM
I'm sorry for not giving more detail. The numbering restarts for each new table. Yes I can select the column and set the style explicitly. I now realise where you are coming from regarding the use of styles, I do apologise for my stupidity:blush

You are indeed correct, if I apply the style after the html file has been imported and then edit as required, the numbering automatically corrects itself.

Thanks once again for your help and patience.

fumei
05-06-2008, 10:13 AM
You are most welcome, and thank YOU for your demonstration of persistence. Good for you.

BTW: it is NOT stupidity. Not knowing something is not stupidity.

Stupidity is when one refuses to listen when knowledge is offered.