PDA

View Full Version : Using VBA to insert page numbering in Word 2003



mang
01-23-2007, 04:42 PM
Hi all

I'm trying to insert page numbers into a template via a VBA macro in MS Word 2003.

I need the page numbers to be inserted in a non-standard position in the template (i.e. to the far right and halfway down the page). At the moment I have only been able to insert the pages in the footer with left/right alignment etc.

Does anybody know how I can set the position I would like the page numbers to appear in the template?

I have been looking around for answers, but I haven't done any VBA programming in a while so I thought I might try here :)

Any help would be *much* appreciated.

Thanks in advance
mang

TrippyTom
01-23-2007, 05:53 PM
You don't need VBA for this. You can still do it in the header/footer area. Just make a textbox or shape and place it on the side of the page where you want the page number. Then use the header/footer toolbar to place the page number in your text box (or shape).

mang
01-23-2007, 06:37 PM
Thanks Tom, on re-reading my post it isn't really clear what I want to achieve. I need this task of inserting the page number to be automated. I have a piece of code that takes away graphics and other things from the header and footer area. This code works fine, however it deletes the page numbers. So I want another piece of code to follow after which re-inserts the page numbers at the desired position.

I'm trying to automate the process of manually moving the page number up the page by selecting the frame containing the page number and then modifying the settings so that it will appear where I want it to.

I hope this makes sense, if not let me know and I can clarify further.

Thanks again
Mang

mang
01-23-2007, 06:38 PM
Edit.

mang
01-23-2007, 06:39 PM
Edit for double post.

TrippyTom
01-24-2007, 10:49 AM
Can you post the code you have and we can go from there?

fumei
01-30-2007, 06:51 AM
Yes, we need some code.