Thank you so much for this. I have created several template documents I use all the time with your help. It has saved me hours of manually inputting names and dates that I would always miss before.
Thank you for this video! Your example led me to FormFields which I'm using in my Word 2013 document instead of Bookmarks. I never would have arrived at this solution without your video.
Hi, in your first line of code what is "lname"? If is the Bookmark name what is "fname" doing in the next line? I am very confused. I thought the Bookmark name was the one in brackets? And what is the Me in the Me.TextBox1?
Is there a way to have a UserForm created with a Submit button, that when clicked will enter the entire contents of the UserForm into my Word Document? (including not just textboxes, but also radio buttons, checkboxes & labels)
Before I go too far down the rabbit hole is there a way to set a bookmark within a one of these? If not, there may be a better way to do what I want to do. I want to include a certain section only in certain circumstances, but that section also contains text that I'd like to autofill. I.e. if my report requires the inclusion of a common element and that common element contains a variable such as a report outlining say the use of a plot of land, I say farm, it autofills a wall of text about farms, and then I also want to say specifically cattle versus horses or sheep within that wall of text.
Great tutorial, thank you. I'm actually stuck on how to use one of the values a user has entered multiple times within a document i.e. enter a name once and use that name multiple times. If you have any thoughts on that it would be much appreciated.
You hit the nail on the head. You can't use one variable multiple times. You have to create a new variable for every one of the places you want to go. This seems inefficient, but it's just Microsoft.
Hi learning engineer, What should we do to make the userform dialog box appear at 0:30? Do we have to save the doc that we create in macro enabled or in template? I'd appreciate your reply. I"m a real novice. Thanks man.
Hi LE, I tried as per your comment but I didn't see the security thing you mentioned in the trust certificate. It looks like your video is for people who are already familiar with the basics. Would you do a step by step video on how to make that dialog box appear so we can simply type in and the info will show in the doc just like what we see? I'd be thankful. I want to make a template so my colleagues can simply use it and type in the info without having to copy and paste table which is really annoying. I just want to help simplify my friends work on preparing report on student's progress, and mine, that's all. If you could help on that, I'd be thankful.
For multiple entries of the same data, I tried copying the Bookmark to an additional location but this just removes the original bookmark. Do I need to change the Range in someway?
Thank you for teaching me how to do this. We use Word to print labels for our moulding samples and typing out a different stain color each time we need a new label is tedious.
+Ramp10er Create a button and in the button's code like at 4:44, lName.Text = "" fName.Text = "" cName.Text = "" iName.Text = "" hlName.Text = "" Me.Repaint
+Ramp10er Sorry, that clears the text boxes. Use ALL the same code from 4:44 except for replacing all the Me.TextBox2.Value with an empty quotes like the previous code I provided.
How, then, do I then get data I set up in a text box to repeat elsewhere in the same template {REF textboxname} does not work, including in the header? Further, how can I populate this data across multiple templates? I've been banging my head for the entire workweek searching and trying out solutions. I'm trying to create a user form that will populate data 1) across multiple templates, 2) populate some of the data the user entered into a header/footer, and 3) populate the user=entered data in such a way that it repeats in the same template. I've followed your instructions on this video to create the form thus far (everything works except repeating a data field or applying that data into a header and second template).
Ok. You have several issues going on here. First, for each bookmark in the document that you want to insert data into, you have to have its own variable and has to be loaded separately from the form item. If this seems dumb, it is. Second, it is unlikely that it will load into multiple templates, but I could be wrong. I would send the data to a text file on the computer that the other templates read from. See this video. ua-cam.com/video/_PoVbjmjLaY/v-deo.html
Thansks for your great tutorial! This used to work for me, now it won't open as macros have been disabled or something? I'm in Spain and of course word here is in Spanish so can't figure out what to do? Any advice? :)
@@LearningEngineercom Thanks! Yes, I have been trying to figure this out in Spanish haha! It's really difficult to find the correct settings in English so I can try and figure it out in Spanish for Window 7/Word 10? I'll keep looking for a good tutorial. Thanks for your time! :)
Can you help me with my assignment. This is what I have to do: •An application is needed to customise the footer of report documents with the user’s department name: He would like you to incorporate the use of a VBA form. The user must be offered a choice of departments (including an option for the Director), with the selected Department being added to the footer without destroying the text already in the template’s footer.
I am using Word 2010. I have created macro enabled template to fill students form using info by you in this video. Now I wanted: 1: to use saveAs command such that the fileName becomes value in textbox1. 2: to make the document ready for the next student, after saving the first one. Please guide how can I do these?
How can I create more than 1 indicator? For example for Name I want to have 2 outputs. Name: Ryan So "Ryan" was doing this and the "Ryan"... Thanks a lot.
It would be nice if this tutorial began by informing the viewer you must have significant knowledge and experience with these specific operations to understand what is happening.
Thank you for the swift response! In Word 2013 it *appears* to take the formatting of the initial bookmark and copy it to all cross-referenced areas. That said, it's probably just me being stupid!
Hi, I'd like to first say thanks for the great video, was very helpful. Do you know how to do the following: 1. I have the dialogue open each time the document is opened but if I fill in the dialogue box the second time it doesnt delete the original text, instead it adds the new text to the old text, can I make it delete the old text if new text is entered? 2. How can I reference this bookmark text elsewhere in the document? If I try inserting a field for "Ref" and select the bookmark it comes out blank, same goes for using cross reference
LearningEngineer.com I worked it out, thanks for the quick response. If anyone else wants to create a UserForm to edit "Custom Document Properties" follow the UA-cam video above but for the Private Sub Code use the following code and copy the ".Custom" line for as many properties as you require: Private Sub CommandButton1_Click() With ActiveDocument .CustomDocumentProperties("Project Number").Value = Me.TextBox1.Value UserForm1.Hide .Fields.Update End With End Sub
Thanks for these tutorial. I love VB but making codes gives me a hard time. I like exploring... How to clear the document if I want another data to be formatted? Let's just add a clear button if client made a mistake or for you instead makes editing...
I want to preserve my form from edits but allow the user to insert text and print it and save as a copy. If I password protect it I get the following error message, "Run-time error '6124': You are not allowed to edit this selection because it is protected.". What is the best way to do this? Should I have it open as a copy?
LearningEngineer.com How would I do so without allowing the user to change the original document. How would I, for example, have the user open and fill out the form and not give them save as copy and/or print it? The original would stay as is. Thank you
LearningEngineer.com I saved it as .dotm, changed the security warning "Macros have been disabled", and resave it. I went into the Trust Center and selected "Trute access to the VBA project object model". Idon't get the form fields after saving.
You would need to clear the bookmark. Instead of attaching the variable like lName.Text to a text box just clear it with a null value, such as lName.Text = ''. Then repaint the document.
Great video but im having this error where i click my submit button but it says Compile error : Invalid use of property and i click ok on it and it brings me up to the properties of the submit button and highlights the words Private Sub CommandButton1_Click() -Please Respond if you can
The code is NOT within worksheet or module, it is contained in UserForm1 object, so in any procedure used within this object, instead of UserForm1, you can use "Me".
I found this a little difficult to follow, having to rewind and rewatch multiple times - it looks like the guy is using keyboard shotcuts to selct items on the screen without saying so, as he says things like this will create x, but the cursor is in the wrong place and you can only tell that something has changed by noticing a tiny icon looks a little different! Got there in the end though!
Thank you so much for this. I have created several template documents I use all the time with your help. It has saved me hours of manually inputting names and dates that I would always miss before.
2023. And ur video rocks! Thanks a lot!
Thank you for this video! Your example led me to FormFields which I'm using in my Word 2013 document instead of Bookmarks. I never would have arrived at this solution without your video.
Hi, in your first line of code what is "lname"? If is the Bookmark name what is "fname" doing in the next line? I am very confused. I thought the Bookmark name was the one in brackets? And what is the Me in the Me.TextBox1?
Could I use the 'userform1.show" in a macro button to make the form pop up at the click of a button?
Is there a way to have a UserForm created with a Submit button, that when clicked will enter the entire contents of the UserForm into my Word Document? (including not just textboxes, but also radio buttons, checkboxes & labels)
Yes
Super helpful... Can't thank you enough brother
Before I go too far down the rabbit hole is there a way to set a bookmark within a one of these? If not, there may be a better way to do what I want to do. I want to include a certain section only in certain circumstances, but that section also contains text that I'd like to autofill. I.e. if my report requires the inclusion of a common element and that common element contains a variable such as a report outlining say the use of a plot of land, I say farm, it autofills a wall of text about farms, and then I also want to say specifically cattle versus horses or sheep within that wall of text.
Great tutorial, thank you. I'm actually stuck on how to use one of the values a user has entered multiple times within a document i.e. enter a name once and use that name multiple times.
If you have any thoughts on that it would be much appreciated.
You hit the nail on the head. You can't use one variable multiple times. You have to create a new variable for every one of the places you want to go. This seems inefficient, but it's just Microsoft.
Hi learning engineer,
What should we do to make the userform dialog box appear at 0:30? Do we have to save the doc that we create in macro enabled or in template? I'd appreciate your reply. I"m a real novice. Thanks man.
+Tua Parulian Yes, you have to change your security settings to get it to come up and save it as a template. At 5:23 it shows you the code.
+LearningEngineer.com
Thanks for your reply, but I still don't know where we can change the security setting. Can you tell me?
+Tua Parulian It should be under the Developer tab or in the Trust Center which is under Options.
Fantastic, I'll try that. Thanks a lot, LearningEngineer.
Hi LE,
I tried as per your comment but I didn't see the security thing you mentioned in the trust certificate. It looks like your video is for people who are already familiar with the basics. Would you do a step by step video on how to make that dialog box appear so we can simply type in and the info will show in the doc just like what we see? I'd be thankful. I want to make a template so my colleagues can simply use it and type in the info without having to copy and paste table which is really annoying. I just want to help simplify my friends work on preparing report on student's progress, and mine, that's all. If you could help on that, I'd be thankful.
For multiple entries of the same data, I tried copying the Bookmark to an additional location but this just removes the original bookmark. Do I need to change the Range in someway?
Thanks! How do you create the "submit" button?
How can i clear the bookmarks without deleting them if i want to add information for a second time ?
Does anyone know where to get my submit box to get those scripts? Do i type them manually?
This document should work learningengineer.com/cloud/docs/Automated%20APA%20Form%20Document.docm
Is there anyway that I can make 01 userform and use it for 3-4 document files?
It doesn't work for me. When I create a form (UserForm1) and call it from autonew (Userform1.Show). I get the error "424" Object not found.
Thank you for teaching me how to do this. We use Word to print labels for our moulding samples and typing out a different stain color each time we need a new label is tedious.
hi, how do you know what code to write in the Command Button form?
How to clear the text you have input in the textbox ? I can't figure out the code...
+Ramp10er Create a button and in the button's code like at 4:44,
lName.Text = ""
fName.Text = ""
cName.Text = ""
iName.Text = ""
hlName.Text = ""
Me.Repaint
+LearningEngineer.com Code not working... But the code on your video does work...
+Ramp10er Sorry, that clears the text boxes.
Use ALL the same code from 4:44 except for replacing all the Me.TextBox2.Value with an empty quotes like the previous code I provided.
Thank you so much Le. But my userform isnt working. I keep getting error 424, What did I do?
How do I go back to the userform to make some edits? I'm lost
How, then, do I then get data I set up in a text box to repeat elsewhere in the same template {REF textboxname} does not work, including in the header? Further, how can I populate this data across multiple templates? I've been banging my head for the entire workweek searching and trying out solutions.
I'm trying to create a user form that will populate data 1) across multiple templates, 2) populate some of the data the user entered into a header/footer, and 3) populate the user=entered data in such a way that it repeats in the same template.
I've followed your instructions on this video to create the form thus far (everything works except repeating a data field or applying that data into a header and second template).
Ok. You have several issues going on here. First, for each bookmark in the document that you want to insert data into, you have to have its own variable and has to be loaded separately from the form item.
If this seems dumb, it is.
Second, it is unlikely that it will load into multiple templates, but I could be wrong.
I would send the data to a text file on the computer that the other templates read from.
See this video.
ua-cam.com/video/_PoVbjmjLaY/v-deo.html
Can you repeat a bookmark for 2 different locations in your document but yielding the same value from inserted information?
Yes and no. Yes, you can repeat information from once source; however, the bookmarks have to have their own unique names.
Thansks for your great tutorial! This used to work for me, now it won't open as macros have been disabled or something? I'm in Spain and of course word here is in Spanish so can't figure out what to do? Any advice? :)
You have to enable macros in your security settings in Word or when you save the file.
@@LearningEngineercom Thanks! Yes, I have been trying to figure this out in Spanish haha! It's really difficult to find the correct settings in English so I can try and figure it out in Spanish for Window 7/Word 10? I'll keep looking for a good tutorial. Thanks for your time! :)
wow! You are the best! Thank for the video!
Can you help me with my assignment. This is what I have to do:
•An application is needed to customise the footer of report documents with the user’s department name:
He would like you to incorporate the use of a VBA form.
The user must be offered a choice of departments (including an option for the Director), with the selected Department being added to the footer without destroying the text already in the template’s footer.
Cant get my bookmarks to work I can type in but add button stays grey. Ive open and saved as macro WB. Im lost this is harder than excel!
how can I reopen the userform once I've submitted it once, on the user side. To edit some of the forms for instance.
When it opens, don't let it run the macro.
I am using Word 2010.
I have created macro enabled template to fill students form using info by you in this video.
Now I wanted:
1: to use saveAs command such that the fileName becomes value in textbox1.
2: to make the document ready for the next student, after saving the first one.
Please guide how can I do these?
how can i round an answer like ,153 to 0,153???
I was looking on the web for an answer but cant find any:( (word vba)
How to open ms word in form1 or child form or richtextbox or panel box whatever and save vb btn automatic in specific drive
Bookmarks disappear after successfully running the userform the first time. How to fix this?
How can I create more than 1 indicator?
For example for Name I want to have 2 outputs.
Name: Ryan
So "Ryan" was doing this and the "Ryan"...
Thanks a lot.
Create another bookmark and in the code send the input to it as well.
It worked! Thanks a lot!
As you explained to me:
Dim Nome2 As Range
Set Nome2 = ActiveDocument.Bookmarks("Nome2").Range
Nome2.Text = Me.TextBox1.Value
It would be nice if this tutorial began by informing the viewer you must have significant knowledge and experience with these specific operations to understand what is happening.
I see your point, but the video is only six minutes. The description of the video does tell the view that Visual Basic will be used.
You have to go into Visual Basic under the developer tab. The name of the form should be in the list on the left.
Thank you for the swift response! In Word 2013 it *appears* to take the formatting of the initial bookmark and copy it to all cross-referenced areas.
That said, it's probably just me being stupid!
Hi,
I'd like to first say thanks for the great video, was very helpful. Do you know how to do the following:
1. I have the dialogue open each time the document is opened but if I fill in the dialogue box the second time it doesnt delete the original text, instead it adds the new text to the old text, can I make it delete the old text if new text is entered?
2. How can I reference this bookmark text elsewhere in the document? If I try inserting a field for "Ref" and select the bookmark it comes out blank, same goes for using cross reference
Or is there a way to use this form tutorial to change the "custom document properties"
If you copy the bookmark and put it elsewhere using the same reference name, it should put in the same information as the first input.
LearningEngineer.com Do you know if it is possible to use the UserForm to edit/update "Custom Document Properties"
LearningEngineer.com I worked it out, thanks for the quick response.
If anyone else wants to create a UserForm to edit "Custom Document Properties" follow the UA-cam video above but for the Private Sub Code use the following code and copy the ".Custom" line for as many properties as you require:
Private Sub CommandButton1_Click()
With ActiveDocument
.CustomDocumentProperties("Project Number").Value = Me.TextBox1.Value
UserForm1.Hide
.Fields.Update
End With
End Sub
LearningEngineer.com Linden Bromwich How exactly do you copy the bookmark?
Thanks for these tutorial. I love VB but making codes gives me a hard time. I like exploring... How to clear the document if I want another data to be formatted? Let's just add a clear button if client made a mistake or for you instead makes editing...
I want to preserve my form from edits but allow the user to insert text and print it and save as a copy. If I password protect it I get the following error message, "Run-time error '6124': You are not allowed to edit this selection because it is protected.". What is the best way to do this? Should I have it open as a copy?
Yes, you can open it as a copy, or you have to change the security settings.
LearningEngineer.com How would I do so without allowing the user to change the original document. How would I, for example, have the user open and fill out the form and not give them save as copy and/or print it? The original would stay as is. Thank you
Theola Ross I should have said ..not allow them to save to the original form. They would save as copy and/or print it? Thanks again.
Theola Ross You simply need to save your original document as a template, which won't let them save it as the original.
LearningEngineer.com I saved it as .dotm, changed the security warning "Macros have been disabled", and resave it. I went into the Trust Center and selected "Trute access to the VBA project object model". Idon't get the form fields after saving.
Thank you for making this video
Type the names of the 5 windows you use that represent Userform?
please answer 🥺
Hi
Can you make a tutorial how to input a text from visual basic, based on formula on visual basic?
Could you create user and password on file word ???
I don't see why not. You would want something like this: ua-cam.com/video/_PoVbjmjLaY/v-deo.html&lc=
Thank for your help bro I owe you one.
Greetings
hello how to feed a listbox on UserForm word vba 'Thank you for everything'
thank you for the video. Are you also an airline pilot ?
Good video but how to erase the last data when you put a new data
You would need to clear the bookmark. Instead of attaching the variable like lName.Text to a text box just clear it with a null value, such as lName.Text = ''. Then repaint the document.
LearningEngineer.com OK i will try thank you
LearningEngineer.com
Great video but im having this error where i click my submit button but it says Compile error : Invalid use of property and i click ok on it and it brings me up to the properties of the submit button and highlights the words Private Sub CommandButton1_Click()
-Please Respond if you can
Maybe I am missing something but what kind of object is "Me"?
The code is NOT within worksheet or module, it is contained in UserForm1 object, so in any procedure used within this object, instead of UserForm1, you can use "Me".
I found this a little difficult to follow, having to rewind and rewatch multiple times - it looks like the guy is using keyboard shotcuts to selct items on the screen without saying so, as he says things like this will create x, but the cursor is in the wrong place and you can only tell that something has changed by noticing a tiny icon looks a little different! Got there in the end though!
I have a new video that I created on this topic at ua-cam.com/video/g5J4tPlN-sM/v-deo.html
Not easy to follow at all - jumps all over the place - not good for a beginner
I also have another video that covers the same information which you might find easier to understand: ua-cam.com/video/slTDxIWvND0/v-deo.html
Yeah, this was completely confusing.