Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-21-2014, 01:31 AM
Simoninparis Simoninparis is offline VBA Code in a UserForm module to delete a Command Button which opens the userform Windows 7 64bit VBA Code in a UserForm module to delete a Command Button which opens the userform Office 2010 64bit
Novice
VBA Code in a UserForm module to delete a Command Button which opens the userform
 
Join Date: Feb 2012
Posts: 4
Simoninparis is on a distinguished road
Default VBA Code in a UserForm module to delete a Command Button which opens the userform

Hello all,



I hope the title says (nearly) everything.

In MSWord, I am trying to develop a system in which:

1 User opens a document (document is write protected)
2 User Clicks on a "Start" button on the doc
3 The "Start" button opens a Userform into which users input data in required formats
4 The UserForm puts all the data in the appropriate place on the main document
5 The document is saved as "input1_input2_input3.doc" - inputs from UserForm.

I can get all the above to work. But....

Problem:
Between 4 and 5, or after 5, I would like to get the "Start" command button to be deleted.

I have tried recording a macro and pasting the code into the UserForm module code. No matter whether I use ThisDocument or ActiveDocument, it does not work. It appears that it wants to act on the UserForm.

Do I need (somehow) to set the focus to the main document?
I am sure this can be done but for the moment it is beyond me.

Any help would be most welcome and much appreciated.

Many thanks,
Simon


BTW: Because some of my colleagues use antique PCs, I am obliged to save it as 97/2003 format.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command button to show userform suddenly stopped working jpb103 Word VBA 0 05-22-2014 06:05 AM
VBA Code in a UserForm module to delete a Command Button which opens the userform UserForm Search, delete issues johndough Excel Programming 3 05-11-2014 11:44 AM
VBA Code in a UserForm module to delete a Command Button which opens the userform Is it possible to take an input from a UserForm in one document to a UserForm in a do BoringDavid Word VBA 5 05-09-2014 09:08 AM
Userform Code not quite right - help please vbanovice Word VBA 1 09-29-2013 09:20 PM
Word doc bug when closing from userform command button click macro Joe Patrick Word 1 07-05-2011 08:53 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:20 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