PDA

View Full Version : Script to number pages



georgeeasten
02-10-2011, 03:08 PM
I have posted the same question without answer so here I pose the question in different terms:

I have the following set documents:

01 - Front Sheet.doc
04 - Bill.doc
08 - Schedules.doc
09 - Certificates.doc
10 - Back Sheet.doc

I need a script so I can consecutively number documents with these names.

01 - Front Sheet.doc will be Page x to Page y ¦
04 - Bill.doc will be Page y+1 to Page z ¦
08 - Schedules.doc will start with Page y+1 and so on.

Documents with these names will be created with different file paths each time. However, each set of documents will always be contained in their own uniquely named folder.

I am sure this is possible but I have no idea how to script it. Surely one must be able to link files in the same folder and in which case this should surely be possible.

I envisage a new script for each document following on from the previous but just adding 1 to the end number then the page numbers should follow on - right? 01 - Front Sheet.doc can have normal numbering and then each document following that will read the preceding.

The trick, I suppose, will be linking to a particular file name within the same folder as the subject document rather then using hyper-linking which will not be flexible with file paths.

I REALLY need help with this - you have no idea how much this is bugging me!!! :bug:

Please, please, please help me.

Many thanks

George

fumei
02-11-2011, 03:46 PM
If you mean "link" as some sort of real-time linking, nope, not possible.

I presume this is typo.

01 - Front Sheet.doc will be Page x to Page y ¦
04 - Bill.doc will be Page y+1 to Page z ¦
08 - Schedules.doc will start with Page y+1 and so on.

08 - Schedule will start at Z + 1 (yes?).

All you can do is open each file, do your numbering, store that last number, open th enext file, and use X + 1 as the starting page number. However, if the previous file has a page added ...and this is important...or if a different printer driver is looking at it, then there will be NO updating of automatic page numbers.

So if 01 - Front Sheet now ends as y +2 (or the printer driver thinks it does!!), 04 - Bill will STILL start at y +1.

"Surely one must be able to link files in the same folder and in which case this should surely be possible."

Not surely. Link how? And why would being the same folder make any difference whatsoever?

Can you do this kind of sequencing? Sure. But it will never be dynamic, or any sort of automated updating. You would have to execute the script every time. PLUS, and automated scripting would mostly likely go through the file in the folder alphabetically. Which may cause issues.

georgeeasten
02-11-2011, 03:57 PM
Thanks Gerry.

I have posted this question elsewhere and did not have a single reply.

It seems this is going to be more hassle than it is worth! Given that there are only ever going to be 4 files I think it is best to go manual and stop being lazy.

I just like the challenge. I have very little experience with VB but I enjoy trying to find a solution.

Word really should have a better solution than master documents. Never mind.

Thank you for your input.

Enjoy your retirement - all the best.

fumei
02-14-2011, 11:34 AM
Like I said, it is possible, and yes, you could have each document do an "update" every time it is saved.

In other words, any time you say ANY of them, all of them are opened and page numbering adjusted. That would also mean that the document you just saved could be adjusted and have to be saved again.

If it is just 4 docs...aieeee! No, too much work.

Master documents. Shudder. No, they are a disaster.