Generating a New Number in Sequence for Each New Document in Microsoft Word 2010

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ • 88

  • @jamesmaldonado8354
    @jamesmaldonado8354 8 років тому +10

    what did you paste on Macro? thnaks!

  • @emilywebster5954
    @emilywebster5954 9 років тому +5

    Does the number change when you need to print 100 documents and each printed document needs to be a different number?

  • @mojcaarnol9122
    @mojcaarnol9122 8 років тому +2

    Hi. Where can I find the text that you have been paste it on the macro? Thank you!

  • @charlestondayschool
    @charlestondayschool 11 років тому

    Help, your directions are great but I am lost. I cannot seem to find the .txt file in the folder C:\Ub_inc\settings.txt and I get all kinds of error messages when I copy and paste the coding from your website in the VBA. I follow the steps up until that point and then I am lost.

  • @dudleylanham6802
    @dudleylanham6802 8 років тому

    Have i done something wrong i have copied exactly as said changing drive location etc. but when i save doc and start a new 1 number doesn't increase

  • @lwilcox3896
    @lwilcox3896 5 років тому +1

    I followed your instructions to the letter, and when I bring up my template, the program wants me to run the macro before it will enter the number. How can I fix this?

  • @virtuallyitpeople2503
    @virtuallyitpeople2503 6 років тому

    Hi I'm having trouble with the ActiveDocument 1.57 in your video. It keeps saying "Error Expected: list separator or )" and will not go any further. I'm using an updated version of Microsoft 365. Please, can you help me? Thanks, Sue

  • @nd8961
    @nd8961 4 роки тому

    Hi, Thanks for this video. Would it be possible, instead of the .txt file can you kindly show us using a "user form" where we can enter the Start "number" and End "number and it prints those numbers from Start "number to the End "number"?

  • @emilywebster5954
    @emilywebster5954 9 років тому +1

    Does it matter which folder the .txt files is saved in (i.e. does it need to be the C://drive) or can it be saved anywhere on the computer?

    • @LearningEngineercom
      @LearningEngineercom  9 років тому

      No, it doesn't matter. You can even use a network drive. Just make sure you have write privileges.

  • @tracyfrancis8407
    @tracyfrancis8407 4 роки тому

    Is there a way to chage the "Save as" location to be whichever user opens the doc, their "My documents" folder

    • @LearningEngineercom
      @LearningEngineercom  4 роки тому

      If you get rid of the "path" and just save it, it automatically saves it to My Documents by default.

  • @cyrilbaddegama
    @cyrilbaddegama 2 роки тому

    Dear Mr. Michael, I have windows 11, office 2019, i made a settings.text in "C:\Users\badde\OneDrive\Documents\Settings.txt" But cannot make as you describe, please help me. I have made it before few years in my other laptop. But with this new laptop cannot. Hope you will help me this time. Cyril

    • @LearningEngineercom
      @LearningEngineercom  2 роки тому

      Did you try it outside of a Onedrive? Usually, when there is a problem, it has to do with the Read / Write or security settings on the drive you're saving the numbers too.

    • @cyrilbaddegama
      @cyrilbaddegama 2 роки тому

      I have tried different ways. But not successful. please help me

  • @deborahtancredi4959
    @deborahtancredi4959 4 роки тому

    What did you paste on Macro?

  • @danatheodros9356
    @danatheodros9356 6 років тому

    HELLO, I LIKE TO GET MORE INFORMATION ON HOW TO MAKE NUMBERING ON RISO MACHINES TO MAKE RECEIPTS ,TICKETS AND DIFFERENT NUMBERING PRINTINGS .IN ADDITION HOW CAN I ORDER FROM THE PC CONTINUALLY.

  • @amandamachleit8982
    @amandamachleit8982 11 років тому

    I'm in the same jam as Charleston Day School. I've succeed with everything except for locating that file therefore I cannot complete the last task and cant use the invoice! Can you please help and explain to us!

  • @kerynwoolmer7288
    @kerynwoolmer7288 6 років тому

    I'm getting a "Debug" that highlights the bottom area where the text file is stored, however, everything appears to be correct. I created the text {MacroSettings} then on the next line Order=1999 in Notepad and it's filed in C drive under a file called Settings.txt. Can u pls advise where I'm going wrong? I've been playing this this for hours! Thanks so much for your video.

    • @LearningEngineercom
      @LearningEngineercom  6 років тому

      It's probably a permission issue now Microsoft doesn't like it when you save stuff directly to the C: drive. Change the location of the file to something other than the C: drive.

  • @donnacusbert916
    @donnacusbert916 8 років тому

    When i go to paste in the macro the info you show is not available how do i get it on my clipboard..thx

  • @shamaarige
    @shamaarige 8 років тому

    Hi! Thanks so much for sharing this! Quick question- if I am inserting Order number in 3 different places in the document, do I have to recreate the macro thrice? It seems to be inserting the number only in 1 of the 3 places.

    • @LearningEngineercom
      @LearningEngineercom  8 років тому

      No, I would first try to copy the bookmark Order into the three different places making sure that they are all named bookmark. If that doesn't work, you simply need to change the part of the code that inserts the number into the document where your bookmarks are. Create three bookmarks named Order, Order1, and Order2 and place them where you want the number to appear in your document.
      Then copy the second to last line in the code (at 1:58) and paste it two more times one right after the other.
      In the next two lines change "Order" to "Order1" and "Order2" and save it
      That should do the trick.

  • @zpepe
    @zpepe 10 років тому

    I did everything as instructed but the Pub_in folder does not get created on my C:\ drive? Any help would be immensely appreciated! Please and thank you
    I get the following error:
    Run-time error '-2147467259 (80004005)':
    Method "PrivateProfileString' of object 'System' failed
    PS: I'm trying to accomplish this using Word 2013 (does the method still apply?)

  • @paintlogic435
    @paintlogic435 5 років тому

    Hi I just came across your video and it's what I was looking for. I am running windows 10 with office 16 and when i was running the macros it gave me an error on Order = Order + 1. Any ideas on how to fix it

    • @LearningEngineercom
      @LearningEngineercom  5 років тому

      "Order" comes from your text file, so you probably have a typo in either the location of the text file or in the line in the text file that "Order" comes from. I would check the case of the word order to make sure that they match and then the location of the text file it references.

    • @paintlogic435
      @paintlogic435 5 років тому

      I have checked the book mark as per the video and it is spelled Order and it still give me an error

  • @saybier
    @saybier 6 років тому

    Now that I have set this up it opens the document as path000# and saves it as a blank page so I end up with the document with the name I give it and a duplicate blank document. How can I stop it from doing that? Thanks!!

    • @LearningEngineercom
      @LearningEngineercom  6 років тому

      Just get rid of the line of code that starts with ActiveDocument.SaveAs and that should stop it from saving the blank document.

    • @saybier
      @saybier 6 років тому

      you are amazing! Thank you!

  • @S_Powers
    @S_Powers 6 років тому

    Hi there. I'm trying out this template and it reads the settings file but it doesn't update the number in the file. The settings file is being saved on a network drive with full permissions. Do you have any other thoughts as to what I can try?

    • @guiguigariglio
      @guiguigariglio 6 років тому

      I'm having the same problem as you, did you find a solution?

    • @S_Powers
      @S_Powers 6 років тому

      No, I enlisted the help of my IT person and through testing - on our particular network - we determined that the problem was that the script had to be saved on each local computer. Otherwise, it didn't work. We didn't continue trying to get it to work because at that point, it was not going to be worth the effort. Sorry :(

  • @maryroseromulo5528
    @maryroseromulo5528 9 років тому

    question. why it is saved as macro-enabled document not macro-enabled template?

  • @eveschoenheimer9941
    @eveschoenheimer9941 7 років тому

    Followed this through to making AutoNew but did not get option to Paste. Any ideas?

    • @feorr1
      @feorr1 6 років тому

      Im having same problem ms 2007

  • @azlisa5622
    @azlisa5622 6 років тому

    Hi Micheal question, I just viewed this tutorial and used the VBA code provided in 2013, however when i ran it said that the office add on had been disabled by system administrator ??? is that possible or could it be operator error on my part such as: method, property or object variable which it is also eluding too ... and with my limited computer behind the scenes knowledge it very well can be ... bc i am clueless to what any of those things mean ;) pls help thx Lisa

    • @LearningEngineercom
      @LearningEngineercom  6 років тому

      If you're using a computer provided to you by a business or organization, it is very likely that macros and VBA are not allowed for security reasons. You would have to talk to IT. If it is your own personal computer, your situation would be strange.

  • @margiemurakami9181
    @margiemurakami9181 7 років тому

    How do I create a Macro button to run this macro with out having to go into the macro

  • @suzannegarrigan7753
    @suzannegarrigan7753 7 років тому

    I was able to create my macro and it works however; it does not run automatically when I open the template. I've checked the permissions on both the template and the text file and they are both fine. Any other suggestions?

    • @LearningEngineercom
      @LearningEngineercom  7 років тому

      Did you put the code under AutoNew? Go to 1:16 and see at the top. (General) AutoNew?

  • @stevewakeford5713
    @stevewakeford5713 7 років тому

    This is so useful. thank you very much for sharing this. may i have a copy of the text file you pasted into the macro ?

  • @jimmytan2573
    @jimmytan2573 6 років тому

    Thanks for the tutorial. However, a bit complicated for me to follow, how about do another video for word 2013 (which i own) ? My intention is to create official receipt which hopefully can generate sequence numbers for each receipt i issue.

  • @ModifyThis
    @ModifyThis 9 років тому

    Doesn't appear to work in Word 2013 since you cannot open a blank template as you did in the video. Do you or anyone know how to make this work in Word 2013?

    • @LearningEngineercom
      @LearningEngineercom  9 років тому +1

      You can open a blank template from
      C:\Users\username\AppData\Roaming\Microsoft\Templates.

  • @enassidawi6506
    @enassidawi6506 8 років тому

    hi . it is working in Word 2013, put i have a problem that i can't see the invoice number and when i check the Txt file i can see order value is increased by 1...... which is great Waw and will be assume if i can see this number change in my Template...
    Please if you can explain?

    • @LearningEngineercom
      @LearningEngineercom  8 років тому

      +Enas Sidawi I would suggest proofreading the ActiveDocument.Bookmarks line of code because from what you are describing, all the code works up to that point. Make sure the name of your Bookmark and the name used in that line of code match exactly.

    • @enassidawi6506
      @enassidawi6506 8 років тому

      +LearningEngineer.com Thank you so much .... finally it's working ..... my mistake was in the step when i want to try it ... when i do right click on the template i click on Open which is wrong ....
      then i try to click on New and its working (New creates new word file.Docx include the new number) :-)

  • @almonsanto8730
    @almonsanto8730 7 років тому

    I searched your learningengineer.com website for the setting.txt file, but could not find it. Can you post it to this vid?

    • @LearningEngineercom
      @LearningEngineercom  7 років тому

      Here is the link. Thank you for bringing the problem to my attention.
      www.learningengineer.org/downloads/Settings.txt?attredirects=0&d=1

    • @tbs045
      @tbs045 4 роки тому +1

      @@LearningEngineercom this redirects to a Japanese Page that is blank. I went to your website to find this code but your videos and information on this do not appear there. Can you paste the code here please?

  • @LearningEngineercom
    @LearningEngineercom  11 років тому

    The file is simply a text file that you can place anywhere so long as the location of the file is reflected in your code. For example, if you place the text file on a network drive you might refer to it in your code as H:\settings.txt. "H" stands for the drive letter, and "settings.txt" is the file name. I hope this answers your question.

  • @timrawcliffe2671
    @timrawcliffe2671 8 років тому

    This worked great for me, however when other people open the document the area where the number goes is blank. I've checked they have have their macros enabled, and that the network drive is the same as the path, but still it doesn't appear to work.

    • @LearningEngineercom
      @LearningEngineercom  8 років тому

      +Tim Rawcliffe You would want to check the file permissions on the networked file to make sure that others can, in fact, write to it.

  • @jeromeds13
    @jeromeds13 6 років тому

    How do you auto advance the number in the text file?

    • @LearningEngineercom
      @LearningEngineercom  6 років тому

      You pull the number from the text file, check to see if a number exists, if it does, add it to 1, the write it back to the text file.
      Order = System.PrivateProfileString("C:\Settings.txt", _
      "MacroSettings", "Order")
      If Order = "" Then
      Order = 1
      Else
      Order = Order + 1
      End If
      System.PrivateProfileString("C:\Settings.txt", "MacroSettings", _
      "Order") = Order

  • @saybier
    @saybier 6 років тому

    This worked wonderfully, is it possible to reset the numbers to start again at zero? I'd like it to reset for each year.

    • @LearningEngineercom
      @LearningEngineercom  6 років тому

      Absolutely, just open the text file and replace the number with a zero and save it.

    • @saybier
      @saybier 6 років тому

      Thank you!

  • @conversationgroupbookclub35
    @conversationgroupbookclub35 3 роки тому

    you lost me at 1:19 :( I think I need a little more marco knowledge to use this video, I can see that you have a text file saved, but that seems to be before step 1 and I am not sure what it should say :(

    • @LearningEngineercom
      @LearningEngineercom  3 роки тому

      Thank you for your feedback. The text file simply contains the number that you are saving. If the text file saves the number on a shared drive, others can read and write to it which ensures that no two documents will have the same number.
      A macro is simply a group of programming code that does something. It should really be called an algorithm for accuracy.

  • @hoh.c.8180
    @hoh.c.8180 10 років тому

    I was being asked to debug when I dont see any problem with that line. Please help!!!

  • @dudleylanham6802
    @dudleylanham6802 8 років тому

    where do i adjust permissions using word 2016

  • @dylanshapiro3292
    @dylanshapiro3292 3 місяці тому

    I was able to get this to work in the year 2024 by starting the macro with Dim Order as String, otherwise it says variable not defined

  • @hoh.c.8180
    @hoh.c.8180 10 років тому

    It says runtime error 5941. The requested member of the collection do not exist.
    I NEED HELP...

    • @LearningEngineercom
      @LearningEngineercom  10 років тому

      You probably didn't create your file on the drive.

    • @TheDANKUZO
      @TheDANKUZO 8 років тому

      Debug ??? ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order, "0000#")

    • @MathieuZelceski
      @MathieuZelceski 7 років тому

      I am having this same issue however I have definitely created the file on the drive and have all the correct permissions. Desperate to get this working!

  • @tacoaddicts5262
    @tacoaddicts5262 7 років тому

    This makes no sense from 2:51 - how did you make the text file to create the number? Video makes no sense from here!

    • @LearningEngineercom
      @LearningEngineercom  7 років тому +1

      You can make a text file by opening up any notepad style program and copying what you see at 2:51 and then save it using the name you used in the word document macro. In this case, I named it Settings.Txt

  • @cyrilbaddegama
    @cyrilbaddegama 8 років тому

    This is Great and it works. Only problem is I have windows 10, office 2013. When open new document it won't change. I need to send invoice to hotels as a travel agent. Need to change invoice no in every invoice which I send. Every time I have to go to view-View Macros-Run. Then it will change number.Help me

    • @cyrilbaddegama
      @cyrilbaddegama 8 років тому

      Thanks Mr.Michael, Yes I did everything as you advise. Also all macros enabled.

  • @kgutz44
    @kgutz44 8 днів тому

    I don't have a "My Template"

  • @LearningEngineercom
    @LearningEngineercom  11 років тому

    Ctrl+V should do it. However, just to be sure, I will upload a text file at my learningengineer blog.

  • @cyrilbaddegama
    @cyrilbaddegama 8 років тому

    Dear Mr. Michael
    sorry I made a mistake before. And I did correct it.
    Now it's working.
    Great work.
    Thank you very much.
    Cyril

  • @anthonyayres6939
    @anthonyayres6939 8 років тому

    I'm trying to insert the current year in front of my number and I'd like the original number to stay in the event i edit and save the doc in years to come. Also, every time I resave the doc, it repeats the number making my number look like this, 000100010001 when all i need is 0001. Other wise the formula is working great and it's eased my mind on the project Im on so thank you very much.

  • @grap79
    @grap79 7 років тому +1

    It works for MS Word 2016! like the fact that it made me work at it to understand what was going on to work correctly and it was very easy!!!! *****

  • @krishnagawai3369
    @krishnagawai3369 6 років тому

    How to do this in php

  • @CurvedSlightly
    @CurvedSlightly 10 років тому +4

    Dude, if you're gonna do tutorials it's better to talk in them.

    • @davidking5105
      @davidking5105 6 років тому

      Yeah I thought I was the only one who found that odd. Yeah it was so weird, I found the info so helpful but so irritating to watch the video.

  • @bill11990
    @bill11990 5 років тому

    Excellent, thanks very much.

  • @charlestondayschool
    @charlestondayschool 11 років тому

    *that's Pub