PDA

View Full Version : Solved: Command button to Spell check only form fields on a protected document



jb8756
02-08-2007, 04:33 PM
I have protected word 2000 forms and I'm running a spell checker on them using some code I found here written by TBUTHE. My problem is that I'm using a command button to do this and it works great however when you print the document it also prints the button. Does anyone know how to stop the button from printing? I did find some code for this used by excel people however it does not work.

lucas
02-08-2007, 06:44 PM
Why not use a custom menu.....add it to the right of help on the main menu...easy to do and no worry about printing.

If your macro is in a standard module:
In word while looking at the normal page(not in the visual basic editor)
1 right mouse click on any toolbar
2 select customize at the bottom
3 select the commands tab
4 at the bottom of the dialog box (look for "save in")select the current document(not normal.dot)
5 in the left pane select macros
6 in the right pane select your macro and hold down the left mouse button to drag it to the position in the menubar where you want it.
7 right click on your button to customize it
8 hit the close button on the customize dialog box
9 save your changes.
10 try it


I think you will have trouble finding a way not to print buttons in Word as they are activex objects, not the same as the buttons you can create in Excel from the forms toolbar.

lucas
02-08-2007, 07:01 PM
I would add that this menu item is specific to the document that you save it in and is portable. Unless you mess up and save it in normal.dot you will only see it when you open the specific file that you saved it in.

jb8756
02-08-2007, 07:10 PM
Steve
Thanks that works great and it’s simple.
Joe

lucas
02-08-2007, 07:23 PM
Glad to help Joe, be sure to mark your thread solved using the thread tools at the top of the page.

jb8756
02-09-2007, 03:02 PM
Steve
Last night you helped me with customizing a tool bar to run a macro in word 2000. I implemented your instruction and they work great. The problem that has show up is when we open the file in word 2003 the custom tool bar does not show up and I can not figure out why. If you like I can send you the word file and if you have word 2003 you might be able to see the problem.
Thanks
Joe

lucas
02-09-2007, 05:49 PM
hi Joe,
did you try creating the button in ver. 2003 and then try moving it? It might be a forward compatability problem. I could create one in 2003 for you and post it for testing if you think it would help.

lucas
02-09-2007, 05:53 PM
Also....are you absolutly positive that in step #4 above that you didn't save it in your normal.dot....it would not be portable if you did. When I think about it that just about has to be the problem...

jb8756
02-09-2007, 07:48 PM
Steve
I double-checked to make sure I saved the document in accordance to step four and I completed that step correctly. I just put word 2003 on my other laptop and I will try and create the form in 2003 like you have suggested and see if that works.
I was also talking with my brother and he was thinking that since there have been alot of security problems with macros that Microsoft might have some how disabled the call that goes with my document and defaults to its Normal. dot as a fail-safe. What do you think?
Thanks
Joe

lucas
02-09-2007, 08:01 PM
Don't give up Joe. We'll figure this out. Hoping Gerry or one of the other Word folks will show up and know something we don't. In the mean time I have attached a file to this post. Try it on both versions and let me know. Look for the word Joe to the right of help on the main menu.

I don't think it's a security issue.....not for the menu button itself...

jb8756
02-09-2007, 08:09 PM
Steve
Thanks again for all your help on this. Do you want me to ship you one of the files to look at? Also in the mean time I will try out building it on 03.
Take care
Joe

lucas
02-09-2007, 08:21 PM
You have 5 posts now Joe. You can attach it to a post....take out any personal info including document properties and click on post reply at the bottom left of the last post. To attach your workbook scroll down until you see a button that says manage attachments.

jb8756
02-09-2007, 08:53 PM
Steve
I hope I did this right :) Here is the file

lucas
02-09-2007, 09:28 PM
It didn't come through Joe. When you click manage attachments you have to browse to your file and then click the upload button..... then close the dialog when the file shows in the box.

jb8756
02-09-2007, 09:39 PM
Steve
I have no clue on this but I took a spare laptop loaded XP and then office 2003 after hours of updates I then loaded the forms from a CD and everything works fine. I will have to test this on other computers to see if everything is OK. I have no clue why
Let ya know what happens
Joe
P.S I’m going off to drink! J

lucas
02-09-2007, 09:43 PM
Think I'll join you. Cheers and let me know how it goes.

jb8756
02-09-2007, 10:19 PM
Steve
I think I know what the problem might have been. It appears the person I sent the file to in an a e-mail to test it only opened it in a temp directory and never saved it to the hard drive and then tried to open it. I will have him re-test in the am to see if this theory proves.
Thanks and sorry for the bs
Joe