Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Apr 2002
    Location
    Richmond, Br. Columbia, Canada
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatically incrementing a number in a template (Word 2000)

    We have a template we use to generate quotes and would like to have the quote number automatically incremented when we use the template. So, every time we use the template to generate a quote the quote number will be incremented by one. All references that I can find about Autonumbering refer to numbers in a document. Any suggestions for solutions, maybe using Excel would be appreciated.

    Thanks,

    John.

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Automatically incrementing a number in a template (Word 2000)

    John,

    A previous thread here pointed to this solution on the MS MVP site. I think there is also an MS knowledge base article that covers this.

    Gary

  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: Automatically incrementing a number in a template (Word 2000)

    If you check on this board (Word) and VB/VBA for threads involving invoice numbers, I think you will find some useful answer(s).

  4. #4
    New Lounger
    Join Date
    Apr 2002
    Location
    Richmond, Br. Columbia, Canada
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically incrementing a number in a template (Word 2000)

    Thanks Gary & John, that has been very helpful. I have a few questions:

    1. I do not want the macro to save the quote as the user will save it and choose a file name. I therefore removed the last line of code and now I have to use File, Save As as the Save button does nothing when I click on it. What causes this and any suggestions for a solution?

    2. Out of curiosity, should I not be able to see the text file settings.txt in the folder? When I go to the folder referenced in the macro code the file is not there. The macro works so why can I not see the file?

    3. When I copied the template document from my hard drive to the network, the AutoNew macro did not travel with the document and was missing in the network copy. I can recreate it in the network-based template but would like to have a solution in case I (or someone else) need to move the template in the future.

    Thanks for any suggestions or help.

    John.

  5. #5
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Automatically incrementing a number in a template (Word 2000)

    John,

    Glad that helped. With regard to your questions:

    1. The normal behavior if you create a new document and then go to save it for the first time, is for the Save As dialog to appear, no matter whether you have clicked on Save or Save As.

    2. Based on Doug Robbins' code, the text file should get created in the root directory of the C: drive. I've just test-run the code and the text file does show up there. ".txt" is not a hidden file type so its visibility should not be affected by IE view settings.

    3. Hard to understand what might have happened, if the macro is in a module associated with the template, then it is going to travel along with the template, no matter where you put the template. Is it possible that you put the AutoNew procedure into a module associated with your Normal.dot, rather than the quote template? - that would produce the situation you report.

    Gary

  6. #6
    New Lounger
    Join Date
    Apr 2002
    Location
    Richmond, Br. Columbia, Canada
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically incrementing a number in a template (Word 2000)

    Gary,

    I did not explain the situation for No. 1 clearly. When I create a document based on the template and click on the Save button, nothing happens. The only way to open the Save As dialog box is to use the Save As command on the File menu.

    Thanks,

    John.

  7. #7
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatically incrementing a number in a templ

    Does anything happen if you use the menu item File/Save or the keyboard shortcut Ctrl+S? If so, then you need to go to Tools/Customize... & drag a new Save button onto the toolbar & delete the old one. If not, when you press Alt+F8 & look through all your macros, do you have one named FileSave. If so, it would be overriding the default FileSave.

Posting Permissions

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