How to create a fillable form with a submit button in Word
Вставка
- Опубліковано 17 лип 2024
- In this tutorial you’ll learn how to create a fillable form with a submit button in Word. I've included the visual basic script in the description below so you can use it during that step.
SOFTWARE:
melcompton.com/recommends/adobe/
GEAR:
Lenovo ThinkPad Laptop: amzn.to/2NvXTGU
Dell Monitors: amzn.to/3r0iwte
VIVO Dual Monitor Mount Stand: amzn.to/3bBmJ0f
Logitech Wireless Mouse and Keyboard: amzn.to/2OX7V4g
Powered USB Hub: amzn.to/3bBmCBR
Focusrite Scarlett Solo: amzn.to/3aMzIwV
Audio-Technica Headset: amzn.to/2Np3Qpl
WC Wicked Cushions Replacement Earpads: amzn.to/3uoihuh
LET’S CONNECT:
Facebook: / therealmelcompton
Twitter: / melissaecompton
LinkedIn: / melissa-compton-17701240
Instagram: / melissaacompton
NOTE: This description contains affiliate links, which means at no additional cost to you, I will receive a small commission if you make a purchase using the links. This helps support the channel and allows me to continue making videos like this. Thank you for your support!
***VISUAL BASIC CODE FOR SUBMIT BUTTON**
Be sure to change the .subject, .body and .to so it will work for you.
Dim xOutlookObj As Object
Dim xEmail As Object
Dim xDoc As Document
Application.ScreenUpdating = False
Set xOutlookObj = CreateObject("Outlook.Application")
Set xEmail = xOutlookObj.CreateItem(olMailItem)
Set xDoc = ActiveDocument
xDoc.Save
With xEmail
.Subject = "Test Email"
.Body = "This is a test email for submit button"
.To = "youremail@email.com"
.Importance = olImportanceNormal
.Attachments.Add xDoc.FullName
.Display
End With
Set xDoc = Nothing
Set xEmail = Nothing
Set xOutlookObj = Nothing
Application.ScreenUpdating = True
End Sub - Навчання та стиль
Loved the video. Once the form is made, do you email it to your person to fill it out as an attachment and then they open it, fill it out and hit the submit button and it comes back to you?
Hello! Yes, you email it to the person as an attachment. They save it to their local machine, open it fill it out, and when they click the submit button it will fire off Outlook. If they experience issues check with your IT department to see if they have it locked down.
Thank you for this tutorial! I've watched a few and by far I have liked this one the most. I found that the pace in which you spoke and the tone of your voice made it easy to understand. The visual turotial was also easy to follow. Now, I will go put it to the test! I've now subscribed and I will look forward to you being my 'Go to' for such tutorials. Thank you!
Awesome video, really helped me understand how to modify fillable forms with active submit button. Thank you.
That was highly informative. Great job. Thank you Melissa.
This was AWESOME! Concise, well paced, on point with the explanations of the functions and what to expect when activating the buttons. Most of all thank you for the Visual Basic Script! I am building new client forms for my Travel Agency. Just a suggestion to change the background from a black to maybe a grey. Questions will these forms launch if someone opens them on their cell phone to complete? I will also test from my end. THANK YOU!!!!!
Following
Superb! PLEASE continue to make these types of tutorials. You are great at it!!!!
Very detailed, Awesome, Great job, very clear and understanding, Thank you for you wonderful information to help others. 😘
You are a brilliant teacher. God bless you for this. It has helped me a great deal.😘😘👏👏👌
Thank you for the tutorial! It was super helpful and easy to follow!
This video was extremely helpful. I have watched it numerous times and now have the confidence to move ahead. I could not find the Visual Basic information, however, so I could copy that for my document. Where is the description link to copy the script? Excited about finding your videos for future review.
Great Tutorial. P.S. Congratulations on 1K subscribers. 🙂
This is so awesome! Thank you!
Excellent video! Thank you so much
Thanks a lot for your great tutorial. Very useful!
nice, direct and easy. will definitely go for more of ur tutorials.
Thank you! Glad it helped!
Thank you much, very brief and informative
Glad it was helpful!
This is absolutely fantastic. I've been struggling with Acrobat's equivalent form capability for THREE days. Before giving up trying to send a form to all our family reunion attendees, I found your AWESOME tutorial! Thank you so much. PS. Although I've already successfully tested it, I'd like to use a link that gives you a reward. Which one do I use?
Hi Richard. Sorry for the delayed response. If you are still interested there is a "thanks" button at the top. If not, no worries at all. I'm glad this helped you.
Thanks
Thank you for this tutorial! It's saving me big time. In the VBA, is there a way to add spaces for the body of the default email? I have a standard message that should go with all forms, but it requires a little paragraph break.
If you want to break to a new line in the body of the email, all you have to do with the VBA code is use the vbCrLf token. This is the standard new-line token defined in VBA. In the "With xEmail" block, you'll have to change the code for the Body property to something like this:
.Body = "First line of text." + vbCrLf + "Second line of text"
This is soooooo amazing! Thank you
Thank you! I'm glad it helped!
This was really helpful, thank you! Is there a way around the docM file extension? Our organization blocks them for security reasons. I read somewhere that you could put it in a zip folder. Is there anyway to include that in the visual basic code? So that it would attach the file in a zip folder instead of just the file?
Thank you for this awesome explanation. As always there is just one thing. Editing restrictions will not let me select any other options other than read only. I'm not in design mode. I think I followed your instructions. Haw can I fix this?
Melissa, found the script! My oversight.
Please where is it
Thank you for this video!!!! It saved me, lol. I have Microsoft 22 and my developer tab does not look like the one in the video. Would you happen to know where I can find the legacy tab/panel in Microsoft 22?
Great video, easy to understand and follow like all your videos. The VBA works well with one email, but what do i do if i was sending to multiple email addresses or CC's
I found your tutorial very useful. I would like to be able to create a multi page form where some information is carried over from the first page to subsequent pages (I.e. member number and first and last name) without having to enter said information multiple times. Recommendations please.
Hello! I will get a tutorial out on how to do this as soon as I can.
Great video, Melissa! Quick question. Can this button be used to save the document in pdf and then attach to the email? Thank you in advance.
Hello! Are you wanting to use the PDF as a fill in form?
Hi Melissa, thank you for this video tutorial. However, I would like to ask you how do I share the form with customers so they can complete it at their end and when they are done, it comes back to me in a word or PDF format? Also, can I insert E-signature functionality? Your response will be highly appreciated.
Great tutorial. If I want to the "submit" to email more than one person, do I need two lines of script for email, or is there a way to write more than one email address into the ".To" line?
Hello! No you can separate them by a comma.
Excellent tutorial. My question is, what if I have a long document and at the end of the document (last page) I have an application or reply page and I only want the client to complete this last page to send with the submit button, can that be done and if so how? Thanks,
This is a great tutorial. Thanks so much. When I test the submit button myself, Outlook loads just fine to send the form. When I send the form to someone to complete, when they hit submit, they are prompted to save the document before sending and I would prefer that not happen. Do you know why that would be happening and how to prevent it? Thanks so much!
Following
I have the same error. What would be the workaround for it?
Any answers or workarounds discovered?
Anyone get an answer to this
I am getting the same error
Hi everyone. If they are being prompted to save it then I would check with your IT department. Since there is VB script and ActiveX Controls some IT departments lock it down because virus's can be sent that way.
Hi Melissa.
This was a very helpful tutorial.
I HAVE JUST ONE QUESTION : How to export the filled details in online excelsheet or google form? - as I don't want to email it further but to save the details as an excelsheet.
If you are wanting to get the information into a spreadsheet or google form I would not recommend using this method. I would create a form via Microsoft 365 online. This will allow you to pull the information in. If they person does not have a Microsoft 365 account they can still fill out the form but you must include a place for them to put in their name. Here is a tutorial on how to use forms. studio.ua-cam.com/users/videox8hqxLLnq-o/edit
@@MelCompton Thanks. That was a great help!
Can you save the form as pdf format and still have the Submit button functioning?
Hey Melissa, thank you for this tutorial, I found it very helpful. Everything works however, once the form is submitted it save the filled form and override the blank form. Is there a way in which people can submit the form but it reverts the a blank form for next time?
With a little bit of VBA magic. I will get it researched and an update put out as soon as I can.
Great Question, this is my question also!
Thank you, easy to understand. Encountering an error, debug 429 Active component can't create object.
I am using Outlook for emails, have signed off and re entered survey with same results. Triple checked programming with same results. Can you advise please?
Hi Kriss, this error is usually due to a corrupt file in the active x controls. You could try telling the ActiveX control to start via services.msc. If you have an IT department I would recommend you let them do it for you. If this doesn't work then they would have to reinstall some of the services.
Thank You for doing this. You are a gifted teacher. I was not able to get this to work and received a popup window - "BASIC runtime error. "323" Module cannot be loaded; invalid format. This popup appeared on top of the script page with line 8 highlighted in blue. How do I fix this? Thank You - Great Job!
This is exactly what I was after for my form thank you. Is there a way to be able to use any type of email system not just outlook please?
Great video, thank you for sharing. Can someone tell me how to edit the form after I have done all these steps?
HELLO
THANKS FOR NICE EXPLANATION.
in fact i need some thing semelar . i write a form for my school and i need a macro for the command button to save the form as the content of student name field, or ID number field.
so how can i write the code for the button to call the text from the field of the text box and save the file as this text,
pleas you help
Thank you for the effort, it is very nice of you. I have encountered an email issue when use it through organization email! It thinks it has infected with malware or it is a malware itself!!.. Is there a work around solution?? Thanks in advance :)
Hi Sam. This is not malware. Please check with your IT department. Some of them will lock down office so it can't run VB Script or ActiveX Controls.
Hi Melissa and thank you for your video. Everything worked until i sent out the forms. When the reciver are trying to fill the forms and click on the submit buttion, then the submit buttom wont work. It just goes to "save file". Do you know why this happens?
Hello! This is a script that runs so check with IT to make sure they have access for macros, scripts and active X controls to run. Sometimes IT has this locked down.
Hi Melissa,
Couldn't locate the VB Script on the comments. If you could help. Thanks.
Thank you for the Tutorial! If I wanted to send the entire template in the email body rather than an attachment how would I do that?
Hello! Just out of curiosity why would you want to do that? Just so I get an idea of expectations.
Can I make forms that can be signed?
This is very informative thank you. I'm working on O365 and have created form, submit button and all appears to work, apart from, the email is not being received after pressing the submit button. The email window pops up, with the form attached, no error message when I click on 'Send' but email has disappeared! Any ideas? Appreciate your help.
Hi Nicki! Is the email address correct in the “to” field in the VB script?
@@MelCompton Hi - it certainly is!! I've since spoken with our IT Department, and we have security features that don't allow macro enables docs to be sent or received :( I think I'll see if I can create a PDF form - it's years since I've done one, but I don't think they use macros. Thanks again though - your videos are great and I will keep watching! Cheers, Nicki
@@nickiwilliamson3590 that’s too bad but I get it. If they will allow you to use Google docs you can do it through there too. There is a video on my channel on how to do it. It also logs the responses and doesn’t use macros. :)
Thank you for the informative tutorial! I am new to this. I am designing a form to submit for my church which does not use outlook. Do I place gmail wherever outlook ls in the vba text? Thank you so much!
Hello! this is not compatible with Gmail. It only works with Microsoft accounts. If you are working with someone using Gmail I would recommend creating a form through Google forms.
@@MelCompton Thank you.
@@MelCompton Thank you
Great tutorial! How do you go back in there to edit? Mine locked me out completely.
Hello! You should be able to follow the steps from where we first put the code in to make changes.
When I double click on a legacy text input box and set parameters to only allow a length of 10, I can still type an unlimited number of charachters in that box. How can I constrain the size of the box so it retains the format of the form?
If you go into the properties of the text box it should let you restrict the character limit.
i can't get the drop down to work.. looks like it does on my end but when i send it they can't see that.. nor is the submit working
Hi,
Awsome! Will this work online within office 365 and not only with desktop apps?
This can be used online with office 365. However, if you have office 365 I would recommend using forms instead of this method. Here is an overview of MS Forms in Office 365. ua-cam.com/video/x8hqxLLnq-o/v-deo.html
Thank you for the video! We appreciate the help. We are running into an issue and I'm sure it is an easy fix, but I can't find it. When a person submits the document, but do not have a MS email account, it will not send. They receive "No valid email accounts are configured. Add an account to send mail" Is there a way to fix this? Thank you Melissa!
Hello! This is only compatible with MS email accounts. If you are working with someone who uses Gmail I would recommend using Google forms.
When I run the debug there's an error at this line - Application.ScreenUpdating = False. The word "false" is highlighted and the error message reads "Invalid outside procedure". How do you fix that? When I change to "True" I get the same message.
Okay, I got by the first bug. Now the error is on line .Attachments.Add xDoc.FullName. Any thoughts on this one?
@@paulnonnenmann2738 Hi! Did you save it as a macro enabled document?
Hi, I'm wanting to create an application form that allows for uploading images and/or documents as well. Is this possible?
Hello! If you are wanting tracking as well this might be better done in Microsoft 365 online using forms.
Thoughts on being able to have a submit button to go to specific dept or person based on their response.
Hello! This type of workflow responses might be better handled by Microsoft 365 online using forms.
@@MelCompton isn't it still pretty much like google forms very basic? I know Jotform can handle this but isn't easy to create.
@@mikeferretti7422 when it first came out yes it was basic but not anymore. I will put out a forms tutorial as soon as I can. It has workflow management and everything now.
Thank you for this tutorial! When I sent a test email, I was able to download it and fill in the blanks; but the "Submit" button would not work. What could I be doing wrong? It gave me a security notice with the option of disabling macros or enabling them. Which is best?
Hello! The submit button won’t work unless the macros are enabled. However, some IT departments have it locked so they can’t be enabled.
I have the same problem. I think the recipient has to save the attachment first. AND they have to be smart enough to save it as a macro-enabled document. Then they can work from a saved version. If they fill the form directly from Outlook, the submit button will be buggy. I find this whole thing disappointing. I think PDF fillable form is better. I worked on my annual reviews for employees forever. Tested it 20 times on my two computers. Got it to work. Sent it to all my employees--and immediately got flooded with emails that they couldn't get the submit button to work, and "why do I have to run a debugger?" and "do I have to save it with macros?" and "what are macros?" etc. I felt stupid.
@@chriscrans9332 I just tried it and on my own computer it worked perfectly, then I forwarded the document to my assistant to see if it worked for her. Same issue--it required her to save the document. now that i see you had the same issue, this may not work for me. I was hoping it would.
@@pamelatrent9674 did you get an answer on how to fix this error?
@@chriscrans9332 They should not have to save it as a macro enabled workbook. Most times this issue is a result of IT locking it down because it's VB Script and Active X Controls.
How do you keep the form once submitted to not be submitted again if accidentally clicked once it has been submitted? Does that make sense?
I'm using a MacBook Pro and my screen looks a little different. I don't have the active X controls option to do the submit button. Any idea on how I can still do this?
Hello! ActiveX is a programming application for Windows based computers only. This solution will not work on a Mac. I would recommend creating a form through Adobe Pro DC or Google Forms.
Can a signature be added?
How is the email being sent? Does it default to whatever your WIndows default email APP is, such as GMAIL or Outlook? If Outlook what if you have 4 profiles in there. What if you send this form to 20 people and they all have different email APPS as their defaul? SOMETHING has to send the email + the attachment, and I don't see anything nor did I hear any discussion about how that is going to happen. Thanks! Appreciate what you're doing here!!!!
Hello! This is only compatible with MS Outlook. You and all your recipients must have MS Outlook. To do this with other apps I would recommend doing it through office 365 on line or LibreOffice.
Hello Melissa, Great video. I do have a question. I seem to be having issues with the code.
Do you think maybe the code has been updated? I copied and paste the exact code in the description but still not working. When i ran the code , error came from this line
Application.ScreenUpdating = False
I changed the parameters but still won;t work
Hello! What is the error you are getting for this line of code?
Is there a way to complete fillable form and data goes into excel spreadsheet?
Melissa, in the VB code you provided, how do I list a gmail account instead of every instance of Outlook? I would appreciate a reply ASAP. Also, since the video is over a year old, does the all the VB script remain the same and will it still work? Shellie
Hi Sheila. This is only compatible with outlook. If you are working with Gmail accounts I would recommend using Google forms.
@@MelCompton I appreciate your prompt reply. As I have already created the Physical Therapy consent form in MSWord and spent hours watching videos and learning about the "Developer" Tool, I may try to find someone to write the VB script I need to use in the document. Thank you, Melissa!
@@shelliebesharse7007 It's not that I won't write the script for it. It's that it doesn't exist. VB script is not compatible with Gmail. VB is specific to Microsoft. Gmail is Google and they have their own form system. So, it's a software incompatibility issue.
@@MelCompton Thank you for clarifying regarding VB and it association with Microsoft. I have also watched videos on using Adobe Acrobat Pro to complete forms. As I mentioned previously, I have created a very good Treatment Consent form in MS Word with the Developer tools. The intended goal was, and still may be, to email the Treatment Consent form Word file to patients prior to coming for their first visit. I guess they could fill out the form in Word, assuming they have Word, and attach and send back to the clinic. If I save the Word document as a .pdf, I would still have to edit with Adobe Acrobat. I guess I will give up on the SUBMIT button, but it sure would have enhanced the document and made it easy for patients to reply. I could save the current document with a different name, take out all the form fillers, save as a .pdf, and try Adobe Acrobat Pro. Never used that either but am willing to learn it as well. Do you have experience with Adobe Acrobat and is my suggestion something to consider? Look forward to watching more of your videos. Thank you, Melissa!
@@shelliebesharse7007 If you have Adobe Pro DC then save it as a PDF and add fill in text boxes. They can then fill it out and send it back to you. You could have them fill and sign via Acrobat Pro and automate the process a little. I do work with Adobe Pro DC and this would be a good tutorial topic as an alternative to Word and Google Forms.
How can I create a place for them to insert an image?
Loved the video and great content however My checkbox does not line up with the text next to it. How do I fix this, please
I am having an error :-( I have sent it to myself and opened it on another computer. The error says "Microsoft Visual Basic for Applications Compile error: Cant find project or library" Please help!
very helpful video. hi ms Meslissa. im using gmail account . dont use outlook. how can i change the visual basic script
Hello! This is only compatible with Microsoft Outlook. Both the sender and receiver must have Outlook installed on their local machine. Since you are using Gmail, I would recommend using forms through Google apps.
@@MelCompton thnx and more power to your channel.
How to get the visual basic script you just pasted?
The visual basic script used is in the description. You can copy and paste it from there.
When I send this form, my recipient fills the form and hits submit. They are then asked to save the file. They are then told they cannot save it because it's a "read only" file and a debugging dialogue opens up. But this will be wonderful if it can work.
ah. this doesn't happen if they download the form. But if they open it directly from Outlook, then it is opened without being saved? Then clicking on the submit button does a buggy thing to try to save it.
@@chriscrans9332 They should not have to save it as a macro enabled workbook. Most times this issue is a result of IT locking it down because it's VB Script and Active X Controls.
Hi, will these forms work on smart phones/android/apple or only on PC? They seem distorted on mobile devices
Hello! No they will not work correctly on mobile devices.
@@MelComptonwould this work on smart phones if it were a pdf file instead of a word document?
Hello, I am so confused when you say "CONTROL V, I would get a visual basic script from a comment". What comment? I have a contract that I have written and I used fillable boxes, when I click Control V a sentence from my document post in that area. I just want to email it, but WORD won't allow me to email it, so I came across your video, which I love this concept of SUBMIT. However once I double click the SUBMIT BUTTON..... I'm not getting what you are getting.
Hello! The VBA script is in the description. You can copy it from there an paste it into Word.
These two lines keep coming up as needing "debugging" before I can activate the "submit" button. What do I need to change here?
Set xOutlookObj = CreateObject("Outlook.Application")
Set xEmail = xOutlookObj.CreateItem(olMailItem)
Hello! are you using Outlook? It is only compatible with MS Outlook.
@@MelCompton I was trying to use my gmail account but I have an Outlook email account also. I will try that. Thanks
I'm still having problems because it wants to use my old work email address to verify my identity and that account has been closed for over 2 years now. It won't accept my personal outlook email I think because the old work email was through Microsoft 365. What should I do?
@@rebeccahamstra1304 Do you have a Microsoft365 subscription for your personal outlook address? If you don't then this will not work.
Hi! How can I add 2 emails instead of one? Thank you!
Never mind… my company disabled macros for security reasons 😩
I got the form to work perfectly on my computer, however, it is not working on the other end. It doesn't work if it is saved in google docs. Please suggest a solution - thanks!!
This is not compatible with Google Docs. Only Microsoft Office. If you have a google user I would recommend creating a form in Google Workspace.
how do we send to people to fill it out? & each time i save the format changes
I did not add a password when restricting the document but now I can't edit the form. How do I "unlock" the document to edit?
Just discovered this myself Kissandra - had the same problem. There's a very small button in the bottom right-hand corner (jprobably designed to not be easily visible) to 'remove protection'. You can then edit again.
Need help...if i want to use Gmail for the submit address and not Outlook, what code should i use? Thanks!
This is not compatible with gmail. I would recommend using Google forms.
I don't see the script...perhaps by now it's buried pretty deep in the comments?
For some reason I cannot type in my text box. The curser will go in front of the box or behind the box but not in the box - what am I doing wrong?
Hi Stacy. What are you trying to type into the box? Is it during the set up or after it's saved?
This was great. Just the black color scheme is a bit too dark for a tutorial with multiple steps.
Thank you so much for your feedback. I’ve added a large highlighted cursor to help with this. If you watch one of my recent tutorials and don’t think it makes it better please let me know and I will make more adjustments. Again, thank you for letting me know.
Hi again, I do not use outlook for mail, I use Gmail. Would you be kind enough to show me the code for that rather than outlook? How would I change the code you have already so kindly shared?
Currently, you can not invoke Gmail from MS Word. I would recommend using Google Forms instead.
@@MelCompton Thank you for responding. that helps!
I'm getting the following error message: Set xOutlookObj = CreateObject("Outlook.Application")
Hi ken! When are you getting this error? After you've saved everything and then go in and use the submit button?
Hi Melissa and thanks, when I select the button I get "Run Time Error 49 ActiveX component cannot create object - I then run Debug and get that message
@@kenberry9987 a run time error 49 is an error with the COM (component object model) and is usually computer specific. I hate to sound like a typical IT person, but once you save the document as a macro enabled doc please close outlook on your desktop and either reopen it or leave closed. Then reopen the word document and try to submit it again. I get notified when you respond so I'm here to see if we can fix it.
I've just realised that I'm not using Outlook, I'm actually using Mozilla Firefox, I guess that could be the problem :-(
@@kenberry9987 yes, that is the problem. I apologize. I assumed you were using outlook on your desktop. That should have been my first question. :( Are you using office365 or Mozilla Thunderbird?
I cant change BODY and email etc. It says compile error.
I think I got it all correct but when I click submit it goes to outlook and I use gmail and nothing is working to change that
Hi Donna. This will only work with outlook. If you need to do something similar with Gmail I recommend using Google forms. I have an older video on how to do that here. ua-cam.com/video/XwcO4wEDmAE/v-deo.html
also how is it to be saved to be sent to others? I sent it to test and it is my version lol
I'm working on a sample survey form in Microsoft 365, trying to teach myself. There is no menu ribbon, only the rectangle of 9 dots in the lefthand corner. Their 'help' is not helpful and only shows me their templates. There is no one here I can ask.
Are you using the online version or desktop version of Microsoft 365?
I want to learn to make a table with submit and reset button and
How to save data in other sheet
Hello! Are you wanting a fillable form in Word or Excel?
Wouldn't using Google forms be much easier option?
Some people use Microsoft, some Google and some libreoffice. I cover them all. People need to use what’s best for them or what their company mandates. Have a great day!
I get an error, "Invalid outside procedure" How do I correct this.
Hello! Are you getting it on compile or where?
I don’t see a “Developer” tab!
Just found it on the side there...
how to add an upload file to the form
Hmmm I clearly did something very wrong none of this worked for me :(
Tried, but was still unsuccessful. Cannot work for Gmail account maybe : Set xEmail = xOutlookObj.CreateItem(olMailItem)
Hello! This only works with outlook. If you need to do this with Gmail I recommend using Google forms.