Solved Word 2010 - Text Box

Mecchi

New member
Local time
8:21 PM
Messages
5
Can I sort of standardize text boxes for a specific document, i.e. whenever a new textbox is inserted it always has the same height and width and is always on the same position relative to the left margin of the document?

Markus
 

My Computer

OS
Windows 7 Ultimate x64
Yes. Format a text box as you like including postition then select the text box. Clicking one of the points/dots/little circles in the corner of the text box makes it easier to select it and not the text inside.

Once you have it selected click the text box icon in the ribbon and you should have the option "Save Selection to Text Box Gallery", fill out the details and now you have your text box template.

If you left the category as default (General) it'll show at the bottom below the built-in text boxes the next time you click the text box icon.
 

My Computer

Computer Manufacturer/Model Number
Self built
OS
Windows 7 Ultimate x64
CPU
Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC)
Motherboard
Asus P5Q-E
Memory
Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)
Graphics Card(s)
Palit GeForce GTS 250 (1024MB)
Sound Card
On Board (ADI AD2000B 8ch HD)
Monitor(s) Displays
Samsung 32in LCD TV
Screen Resolution
1360x768
Hard Drives
2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures)
PSU
550W Antec Neo HE 550
Case
Antec P180
Cooling
Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans
Keyboard
Logitech MX5000 Laser (Combo)
Mouse
Logitech MX5000 Laser (Combo)
Internet Speed
ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up)
Other Info
Gigabyte GN-WP01GS 54g Wireless Lan Card
Two more questions on Text Boxes in Word 2010

Dear Duzzy,

thank you ever so much for the very quick and very useful reply.
Just two more short questions:

1) in order to have it (as a kind of commentary) left to the text which is commented, I have to be with the cursor exactly at the position (relatively to the height of the page) where I want the text box to have?

2) can I introduce a short cut for inserting a new text box (ie the one I have formatted) instead of finding it always at the end of text box templates in the ribbon?

Markus
 

My Computer

OS
Windows 7 Ultimate x64
1) I think yes. I'm not entirely sure what you mean but it would probably depend on the Text Wrapping options as well. All I can suggest is set the Text Wrapping to what you want then play around until you get it right.

2) I had a quick look but the best I could come up with was creating a macro to insert the Text Box and adding either a Keyboard shortcut or Toolbar Button assigned to the macro.

To create the macro I used the Macro Recorder. Start recording and insert your text box then stop recording. I then had to manually edit the macro and delete the first line (ActiveDocument.Shapes.Range........).
 

My Computer

Computer Manufacturer/Model Number
Self built
OS
Windows 7 Ultimate x64
CPU
Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC)
Motherboard
Asus P5Q-E
Memory
Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)
Graphics Card(s)
Palit GeForce GTS 250 (1024MB)
Sound Card
On Board (ADI AD2000B 8ch HD)
Monitor(s) Displays
Samsung 32in LCD TV
Screen Resolution
1360x768
Hard Drives
2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures)
PSU
550W Antec Neo HE 550
Case
Antec P180
Cooling
Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans
Keyboard
Logitech MX5000 Laser (Combo)
Mouse
Logitech MX5000 Laser (Combo)
Internet Speed
ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up)
Other Info
Gigabyte GN-WP01GS 54g Wireless Lan Card
Again thank you,

one last thing (I hope) I find a bit strange though: The textboxes have a frame around them. I thought this would be the easiest thing to have the box "without borders" but I can't get it away.
 

My Computer

OS
Windows 7 Ultimate x64
2 ways.

1) Right click the Text Box and select "Format Shape" at the bottom of the right click menu. Select Line Color > No Line.

2) With the Text Box selected you should get a new tab on the Ribbon named "Drawing Tools - Format", it should be selected by default when you select the Text Box.
In this tab under the section "Shape Styles" you should find "Shape Outline". Click this and select "No Outline" under the standard colors.
 

My Computer

Computer Manufacturer/Model Number
Self built
OS
Windows 7 Ultimate x64
CPU
Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC)
Motherboard
Asus P5Q-E
Memory
Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)
Graphics Card(s)
Palit GeForce GTS 250 (1024MB)
Sound Card
On Board (ADI AD2000B 8ch HD)
Monitor(s) Displays
Samsung 32in LCD TV
Screen Resolution
1360x768
Hard Drives
2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures)
PSU
550W Antec Neo HE 550
Case
Antec P180
Cooling
Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans
Keyboard
Logitech MX5000 Laser (Combo)
Mouse
Logitech MX5000 Laser (Combo)
Internet Speed
ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up)
Other Info
Gigabyte GN-WP01GS 54g Wireless Lan Card
Dear Duzzy,

sorry I did not reply yesterday. I was not in my office (child ill).
Thank you again for the outline advice (no line).
It is just that with the Macro I do not succeed - I never did this before in fact.
What do you mean with "Insert your Text Box" after having started recording?

Thanks Mecchi
 

My Computer

OS
Windows 7 Ultimate x64
Ok first I found a problem with the Macro. When I closed Word and re-opened it the Macro would no longer work. It seems to be a problem if you save your custom text box in the "Building Blocks.dotx" but seems to work ok if you save it in the Normal Template (Normal.dotm). Here is an image that should hopefully be able to explain how to move your existing custom text box to the Normal Template.TextBoxProperties.jpg
1. Rick click your custom text box
2. Make sure your custom text box is selected
3. Click edit properties
4. Change to Normal.dotm
5. Click OK then Close

Macro creation in next post.
 

My Computer

Computer Manufacturer/Model Number
Self built
OS
Windows 7 Ultimate x64
CPU
Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC)
Motherboard
Asus P5Q-E
Memory
Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)
Graphics Card(s)
Palit GeForce GTS 250 (1024MB)
Sound Card
On Board (ADI AD2000B 8ch HD)
Monitor(s) Displays
Samsung 32in LCD TV
Screen Resolution
1360x768
Hard Drives
2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures)
PSU
550W Antec Neo HE 550
Case
Antec P180
Cooling
Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans
Keyboard
Logitech MX5000 Laser (Combo)
Mouse
Logitech MX5000 Laser (Combo)
Internet Speed
ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up)
Other Info
Gigabyte GN-WP01GS 54g Wireless Lan Card
Recording the Macro

1. On the Ribbon click the View tab > Macros > Record Macro

2. Type Macro Name (No Spaces) and description (optional)

3. Store in Normal Template to make it available to all documents

4. Create Keyboard Shortcut and/or Button if desired (Read below about button creation)
EDIT: You can only create one of these when recording a macro. If you wish to create both then you can create one here then the other after. Creating the button after is the same as described later except opening the Customize Ribbon/Quick Access. This can be opened from File > Options > Customize Ribbon or Quick Access Toolbar.
This post should explain how to create a Keyboard shortcut after.

5. Click ok to start recording the Macro

6. On the Ribbon click the Insert tab

7. Click text box then scroll down and select your custom text box. Now you should have your text box inserted on the page.

8. Click the stop button on the status bar
MacroStop.jpg

9. On the Ribbon click the View tab > Macros > View Macros

10. Select the Macro you just recorded and click edit

11. You should be presented with the Visual Basic editor and the following code. Bold text will be different depending on the name of the macro, text box name and your User name.
Code:
Sub [B]MyTextBoxMacro[/B]()
'
' [B]MyTextBoxMacro[/B] Macro
' My Description
'
    [COLOR=Red]ActiveDocument.Shapes.Range(Array("Text Box 3")).Select[/COLOR]
    Application.Templates( _
        "C:\Users\[B]USERNAME[/B]\AppData\Roaming\Microsoft\Templates\Normal.dotm"). _
        BuildingBlockEntries("[B]MyTextBox[/B]").Insert Where:=Selection.Range, RichText _
        :=True
End Sub
12. Delete the line marked in red ("ActiveDocument.Shapes.Range(Array("Text Box 3")).Select")

13. Switch back to the document and run the macro to test

You will notice in the code it references your USERNAME AppData folder. Now it's not necessary but you can change the code to the following
Code:
[B]Dim strAppData As String
    strAppData = Environ("AppData")
    
    Application.Templates( _
        strAppData & "[/B]\Microsoft\Templates\Normal.dotm"). _
        BuildingBlockEntries("MyTextBox").Insert Where:=Selection.Range, RichText _
        :=True
If you have any problems with any of the steps just let me know.


Creating the Button - Quick Access Toolbar

Under the Record Macro window where you give it a name, description etc... click the Button option under "Assign Macro to". Follow these steps to add to the Quick Access Toolbar
CustomQuickAccess.JPG
1. Check your macro is selected
2. Click Add to add it to the Quick Access Toolbar
3. Click Modify
4. Select an icon and give it a display name

Now if all went well it should show under Quick Access Toolbar like this
QuickAccessToolbar.JPG
The display name will show when you hover over it.


Creating the Button - Ribbon

Under the Record Macro window where you give it a name, description etc... click the Button option under "Assign Macro to". Your presented with the "Customize the Quick Access Toolbar" window.

Now you have two options, create a whole new tab or a new group to place your button in. All steps are the same except the first where you choose tab or group.
CustomRibbon.JPG
1. First click "Customize Ribbon" on the left.

2. Click new tab or group. New tabs or groups will be created under the currently selected one although you can move them by dragging them up or down or using the arrows to the right of the scroll bar.

3. Select Macros in the Commands drop down list and select your macro below.

4. Make sure you new group or tab is selected on the right and click Add.

5. Select your tab, group or macro then click rename

6. Give your item a display name and select an icon. Group or tab icons I have found not to show so you only really have to worry about the Macro icon.

When your finished click ok and you will start recording the Macro, step 6 under Recording the Macro at the start of this post.

When finished recording the Macro you should have something like this

Group
CustomRibbonGroup.JPG

Or Tab
CustomRibbonTab.JPG

I hope I've made it as easy as 1,2,3 and havn't missed anything but if you need more help don't be afraid to ask, although I'm going to be busy this weekend so it may take a day or two before I respond.
 
Last edited:

My Computer

Computer Manufacturer/Model Number
Self built
OS
Windows 7 Ultimate x64
CPU
Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC)
Motherboard
Asus P5Q-E
Memory
Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)
Graphics Card(s)
Palit GeForce GTS 250 (1024MB)
Sound Card
On Board (ADI AD2000B 8ch HD)
Monitor(s) Displays
Samsung 32in LCD TV
Screen Resolution
1360x768
Hard Drives
2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures)
PSU
550W Antec Neo HE 550
Case
Antec P180
Cooling
Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans
Keyboard
Logitech MX5000 Laser (Combo)
Mouse
Logitech MX5000 Laser (Combo)
Internet Speed
ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up)
Other Info
Gigabyte GN-WP01GS 54g Wireless Lan Card
Hi Duzzy,

you make such an effort. I will give it a try.
Is the macro (if it works) and the formatting of the textbox etc. then document-based or computer-based. i.e. does it only function on my word on my computer or also on sbd. else's if he/she opens the very same doc.
By the way: where are you?

Mecchi
 

My Computer

OS
Windows 7 Ultimate x64
They are computer based. You can save them in a template other than the Normal.dotm, for best practice, and copy both the document and template to the other computer. Keep them both in the same folder or place the template into the templates folder.
Modify the macro code like
Code:
Set strTemplate = ActiveDocument.AttachedTemplate
    strTemplatePath = strTemplate.Path & Application.PathSeparator & strTemplate.Name
     
    Application.Templates(strTemplatePath). _
        BuildingBlockEntries([B]"MyText"[/B]).Insert Where:=Selection.Range, _
        RichText:=True
"MyText" = What your text box is named.

The above code finds the path and filename of the attached template. If the code is left as it was then the template would need to be placed in the same location as it was on your computer.

The main problem is that the Ribbon buttons are not copied to the other computer making the macro just as hard to use as scrolling to the bottom of the text boxes. If you want to leave the macro out you could rename the text box to "1 - MyText" and change the category to "Built-in" then it should show as the 2nd text box under Insert > Text boxes.

To easily move and rename the Text box refer to post #8. Under step 1 click edit properties and that'll take you straight to step 4 where you can change the Name, Category and Template. If changing the template make sure you have a template opened, if you want it based on the Normal.dotm just create a new blank document and save as a template then proceed to move the Text box.

These are the best solutions I could come up with, with the time I have had but I don't think there's much better.
 

My Computer

Computer Manufacturer/Model Number
Self built
OS
Windows 7 Ultimate x64
CPU
Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC)
Motherboard
Asus P5Q-E
Memory
Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)
Graphics Card(s)
Palit GeForce GTS 250 (1024MB)
Sound Card
On Board (ADI AD2000B 8ch HD)
Monitor(s) Displays
Samsung 32in LCD TV
Screen Resolution
1360x768
Hard Drives
2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures)
PSU
550W Antec Neo HE 550
Case
Antec P180
Cooling
Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans
Keyboard
Logitech MX5000 Laser (Combo)
Mouse
Logitech MX5000 Laser (Combo)
Internet Speed
ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up)
Other Info
Gigabyte GN-WP01GS 54g Wireless Lan Card
Back
Top