sequentially numbering a word document as they are printed

M

mcastillo

How do I create a word template to have a macro that will sequentially number
the forms by a set number requested to print. For example, when I open the
document I would request forms to print 100-200 and than each form printed
would autonumber the forms with 100, 101, 102, etc.
 
J

Jezebel

1. Put a DocProperty field in the document to display the number.

2. Use a UserForm to get the number range.

3. Use code along the lines of

With ActiveDocument

For pFormNum = StartNum to EndNum
.CustomDocumentProperties("FormNumber") = pFormNum
.Fields.Update
.PrintOut
Next

end with

You might need to be more sophisticated about the Fields.Update -- if the
number is in the header or footer or in a textbox, you'll need to specify
the storyrange containing it, eg

..StoryRanges(wdFirstPageFooterStory).Fields.Update
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top