?
Solved

I want to insert a field into a Word document that contains a number that automatically increments by 1 for every page printed.

Posted on 2012-09-14
1
Medium Priority
?
440 Views
Last Modified: 2012-10-01
I want to insert a field into a Word document that contains a number that automatically increments by 1 for every page printed.

Please see the attached Doc914.doc for details.

Could you please advise.

Thanks!
Doc914.doc
0
Comment
Question by:EEuser5551212
1 Comment
 
LVL 77

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 38400116
Do you mean every time the document is printed?

Without mail merge, you would have to use VBA and it couldn't be made completely rigorous.

Simply you could have a VBA macro and a bookmark.

Select the "1" in Sheet 1 of 50 and add a bookmark called, say, PrintCount.
Then run this Macro:
Sub PrintCopies()
    Dim i As Integer
    Dim rng As Range
    
    i = Val(ActiveDocument.Bookmarks("PrintCount").Range.Text)
    Do Until i > 50
        ActiveDocument.PrintOut
        i = i + 1
        Set rng = ActiveDocument.Bookmarks("PrintCount").Range
        rng.Text = CStr(i)
        ActiveDocument.Bookmarks.Add "PrintCount", rng 're-add bookmark
    Loop
    
End Sub

Open in new window

0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question