Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jan 2001
    Location
    Perth, Western Australia, Western Australia, Australia
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    File Version No. in Footer (Word97)

    I have a user who wants to be able to automatically put a version number in a footer each time she saves a new version of her document. Could anyone please tell me if it is possible to write a macro which will put the version number in the footer of the document and how would I prompt for the version number?

    Thanks in advance, Jackie

  2. #2
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Silicon Valley, California, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: File Version No. in Footer (Word97)

    jcavill,

    Try this.

    First, create a custom document property called "Version", as follows: File (menu), Properties, Custom (tab). In "Name", type "Version". Under "Type", choose "Number". In "Value", type 1.

    Next, add a field code to the footer, as follows:
    <pre>{ DOCPROPERTY "Version" * MERGEFORMAT }
    </pre>


    Third, put this code into a module:
    <pre>Sub VUp()

    Dim P

    For Each P In ActiveDocument.CustomDocumentProperties
    If P.Name = "Version" Then
    P.Value = P.Value + 1
    End If

    Next P

    End Sub
    </pre>


    When you run that code, the Version property will be incremented. The field in the footer will reflect the change whenever it is updated, typically when you print, print-preview or save.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: File Version No. in Footer (Word97)

    Word has a feature (at least in Word 2000; I don't remember on 97) that allows you to save versions of a document inside the same .doc. I worry that this could become corrupted, causing the user to be able to access none of the versions, so I hope she is not using this feature.

    If she is, your macro can determine the number of versions in the file by checking: ActiveDocument.Versions.Count. Presumably there is a way for the user to access earlier versions, in which case you would not want to footer to update again (in the earlier version)...some testing might be required to get exact the effect she wants.

    If not, I like Jim's suggestion.

  4. #4
    New Lounger
    Join Date
    Jan 2001
    Location
    Perth, Western Australia, Western Australia, Australia
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: File Version No. in Footer (Word97)

    Thank you very much Jim. This does what she wants - it's great to have a forum like this where expert help is available so quickly.

    Thanks again,
    Jackie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •