Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-16-2015, 08:32 AM
dkohnken dkohnken is offline Help with a Command Button Windows 7 64bit Help with a Command Button Office 2013
Novice
Help with a Command Button
 
Join Date: Mar 2015
Posts: 3
dkohnken is on a distinguished road
Default Help with a Command Button

I have built a Word 2013 form which contains Legacy Controls, ActiveX Controls and the Date Picker from the default controls in the Developer tab.
I am relatively new building forms in Word. I hope this is not too wordy, but I am not sure how to explain it.



This form is for Supervisors and managers to enter information about new Employees. Some of the information, Name, Supervisor name, start date, approving department head and email for department head.

I have added several VBA Macros, one to read the name of the Department Head and get their email from Active Directory. This all works good, even when I open a new document from the template.

I added a button at the bottom of the form to validate all required information, which as a dotm works great. But after saving the dotm file, and open the dotm as a new document the code that I entered in the button's click event is not there. It seems that the code is not being written to the Click event of the new form. If I unprotect the new document and click on the Developer Tab and view the code, All I have is Private Sub Submit_Click() and no code. Listed underneath the new Document in the VBA editor is the original template. Clicking on ThisDocument and viewing the code, I see my Private Sub Submit_Click() with all the code I wrote.

I have gone into the Trust Center and enabled Macros and ActiveX.
I have searched for answers, but found none that work. Am I doing something wrong? Any help would be appreciated. Thank you in advance for all your help.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
command button query smalc Word VBA 2 03-16-2015 08:26 PM
Command Button knp11 PowerPoint 2 01-18-2015 01:41 PM
Help with a Command Button PP Command Button wont run on another PC gerris PowerPoint 6 01-12-2015 10:17 AM
Help with a Command Button Command Button to Print Labels Claytocb Excel Programming 1 02-01-2013 12:20 AM
Help with a Command Button Command Button cksm4 Word VBA 7 02-27-2011 08:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft