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
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.

Question by:EEuser5551212
    1 Comment
    LVL 76

    Accepted Solution

    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
            i = i + 1
            Set rng = ActiveDocument.Bookmarks("PrintCount").Range
            rng.Text = CStr(i)
            ActiveDocument.Bookmarks.Add "PrintCount", rng 're-add bookmark
    End Sub

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
    Outlook Free & Paid Tools
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
    Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now