#1
|
|||
|
|||
Help: how to replace hidden text with unhidden text when typing over
I'm trying to create a mailing label template for our department that has all the cells/fields for the labels ready to click and replace the name/address info but for the unused fields to remain hidden (when printing) so as not to accidentally waste a label sheet. Well, I've taken care of the hidden part, but I can't figure out how to make it so that when you click and start typing, the new info input is no longer hidden text... Is this even possible?
In case it helps, I have attached the template document in question... Thanks for any help! |
#2
|
||||
|
||||
The first macrobutton field in the first cell has a macro reference named 'DoFieldClick'. Change this to 'Unhide' and copy that field to all the other cells. Then add the following macro to the document's 'ThisDocument' code module:
Code:
Sub Unhide() With Selection.Cells(1).Range .Font.Hidden = False .Fields(1).Code.Text = Replace(.Fields(1).Code.Text, "UnHide", "NoMacro") End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
I am a great fan of MacroButton Field prompts. I even wrote an Add-In to let you insert them painlessly. MacroButton Prompt Add-In However, they are sort of useless when you can't see them. You can still use F11 to move from field to field, but that isn't exactly intuitive either. Will this be used by people with versions of Word before Word 2007? If not, I would suggest Content Controls instead.
If it will be used by people with Word 2003 or earlier, you could mark the prompt as hidden without marking the entire field as hidden. Take a look at my Add-In. It is set so that the prompt is in a colored text but what is typed is in the style of the surrounding text. I suppose if the people typing have display of hidden text turned on it makes sense with it not being printed. That would work. I will be attaching a version with both content controls and macrobutton fields in a couple of seconds. In both instances in Word 2007 and later, the tab key will take you to the next place to type. |
#4
|
|||
|
|||
Here is a screenshot and the sample document. Look first at the screenshot. The document is set to show hidden, non-printing characters, including hidden text. In print preview the only thing that would show up would be the first macrobutton prompt.
This document is protected from any editing except that typing/editing is allowed for everyone in certain areas. In this case, in the content controls and in the MacroButton Field Prompts. The first two rows of labels use Content Controls. Unless something is typed in them, nothing will print. The prompt shows up when the content control is activated (clicked in). If someone tries to type elsewhere, they will not be allowed to do so and the Restrict Formatting and Editing pane will show up. In this case, I have the option checked to highlight next area for typing. The next row has three MacroButton Field prompts. The first one is not hidden, the next two are hidden (but with hidden text being displayed). Note that the Content Control was able to have a longer prompt than was the MacroButton field! When the document has editing restricted this way, the tab key moves to the next place the user can type rather than to the next cell. Again this type of protection is not available in earlier versions of Word. Note that the macrobutton prompts are in bold blue text. When someone types in them, the text will be whatever style and color is in use in the table cell, not the bold blue text. That formatting is applied only to the prompt part of the field. The second two fields also have the font formatting of hidden applied only to the prompt. Thus when someone types in them, the typed text is not hidden. I developed that Add-In just so I could easily have the prompts stand out but not stand out after they had been used; it does this automatically and even gives a choice of colors. (It doesn't do hidden text though.) See my next post for some design considerations. Last edited by Charles Kenyon; 03-27-2014 at 07:47 PM. Reason: Add explanatory text |
#5
|
|||
|
|||
Design considerations:
Use a template - a Word Template "Template" is a term of art in Word. It means, for the most part, a special kind of document that no one is supposed to type in. It is a holder of formatting, styles, and boilerplate text. If the user double clicks on it, it does not open. Instead a new document is created, holding all of the text and formatting of the template and having any customizations from the templates. It makes it more difficult for someone to mess up your form by mistake. Templates in Microsoft Word One field per label. If I were doing a mail merge, I would definitely use all of the different fields in each label, possibly even more. However when it is being typed each time, one field per label is sufficient. It would be annoying, at least to me, to have to move to a different field a bunch of times within one label. Three Columns, not Five Consider modifying the layout to eliminate the separator columns. They are put there automatically, but they are unnecessary and in an unprotected format they interefere because a tab will stop in one of those separator columns even though you don't want anyone typing there. Instead have three columns with the indents for the columns where they currently are on the page. It is the indents, rather than the column boundaries that hold your text in place. Again, for mail merge I would not care about the extra columns. Use of the Classic File New Dialog encourages use of custom templates because it makes using them easier It makes it easier to find them when they are stored in the User Templates folder or the shared Workgroup Templates folder. It also makes it harder to open a template by mistake. It is fairly simple to make this dialog the easiest way to start a new document avoiding Microsoft's online templates that are not designed for your business. 2007 Add to QAT - File New Variations in the Versions of Word Hope this helps. |
#6
|
|||
|
|||
Here is another variation on the document. I may turn it into a tutorial.
|
#7
|
|||
|
|||
Thanks
Thank you both for your help and suggestions, I've got a basic but working document .
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to find text and replace with form field containing that text | iiiiifffff | Word VBA | 16 | 06-04-2016 01:47 AM |
Hidden style applied over already-hidden text. | christie | Word | 1 | 08-17-2011 09:10 AM |
Typing into text boxes | Misha | Word | 1 | 07-04-2011 08:08 PM |
Deleting text while typing in Word | cajun62234 | Word | 1 | 04-07-2011 04:40 PM |
Word is typing random text | fiddle1 | Word | 1 | 11-30-2008 10:29 AM |