Creating Unique Form Numbers For Word Documents

  • Hi...


    I have a word doc ( Word Version 2000 ) that has a field in the top left Corner of the page.


    this filed is in the form of :


    CCF-YYYYMMDD-######


    I am in need of VBA code to automatically create this field ( This part YYYYMMDD-###### )


    The CCF part is always there.


    The other requirement is that the ###### is unique.


    Example


    CCF-20061109-000001
    CCF-20061109-000002
    CCF-20061110-000003
    CCF-20061111-000004


    My initial thought would be that I would have to track the numbers used in the ###### part in a separate file.
    Whenever a new number is used, a tracking file is updated.


    Any thoughts ?


    Thank you

  • Re: Creating Unique Form Numbers For Word Documents


    Hi,


    You could use the save as event to trigger a macro. This event could save the workbook, open the original and increment the ID number for the next attempt.


    HTH


    You could use create event to increment the number then copy the number back into the template.


    John

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!