Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text box in Word disappears or duplicates

Status
Not open for further replies.

belindasummerlin

Technical User
Apr 26, 2010
2
US
I have a text box at the top of my page in Word. It is somehow "tied or anchored" to the normal text on my page. When I copy and paste the text, the text box duplicates. When I select all text and delete it, the text box is also deleted. How do I "break" the link of these two elements?
 
Turn on the ShowAll command so that you can see the non-printing characters. You'll never know what Word is doing if you don't keep them in view.

Once they are on, selecting the Text Box will light up the anchor showing you which paragraph break it is being used as an anchor.

The solution to your problem though it to select the Text Box, Cut, move the cursor adjacent to a paragraph that you are not going to copy/paste/delete. Then Paste the Text Box. Now adjust its position to where you want it to appear.


Regards: Terry
 
Great, I'm closer to a solution. I found the anchor you mentioned. The problem is that I don't want the text box to be anchored to any paragraph on my page. The text box is "sitting above" my margin and is on top of a graphic that I have in my header (background). I want users to be able to use the text box as an editable title to their page (Agenda, Regional Director's Meeting, Patient and Family Centered Care Guidelines, etc). But I don't want them to go to the header to edit it because they inevitably move the logo and graphics around by mistake. Are there any other solutions?
 
Presuming you are using Word 2007 or 2010 (possibly W2003 - but I haven't got it here to test).

Create your Text Box. Right-click on its border and choose Layout Options. Check the ABSOLUTE position buttons and the relative to PAGE alignment. Then change the measurements so that the Text Box is centred over the graphic in the Header. This Text Box should no longer be anchored as such as it is positioned using the page edges as pseudo anchors. Make the Text Box borderless and transparent, with its text alignment set to Centre vertical and horizontal.

Another alternative is to use a Table in the header to keep all your text and graphics perfectly aligned: then set a Text Box over the graphic but keep it anchored to one of the Header paragraph marks. That should stop the users accidentally messing up the Header alignment.


Regards: Terry
 
The problem is that I don't want the text box to be anchored to any paragraph on my page. The text box is "sitting above" my margin and is on top of a graphic that I have in my header (background). I want users to be able to use the text box as an editable title to their page (Agenda, Regional Director's Meeting, Patient and Family Centered Care Guidelines, etc). But I don't want them to go to the header to edit it because they inevitably move the logo and graphics around by mistake. Are there any other solutions?

1. standard textboxes ARE anchored to a paragraph.

2. tf1 has a solution in that you can fix a position

3. if what you want is for a user to put text into the header (...and WHY?????), but for them NOT to actually get the header, then a simple VBA solution would work. Do it this way, via a textbox seems strange to me. But...

Caveat: obviously changing the text (by any means) can - and probably will - change the layout of the header.

"Agenda" and "Regional Director's Meeting" have very different lengths!

Me? I would use a keyboard shortcut, or a wee icon on the toolbar "Page Title" that would:
Code:
With ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
  ' do what every it is you want.
for example......


Code:
Sub InsertTitle()
Dim strTextToInsert As String
strTextToInsert = InputBox("Title?")
ActiveDocument.Sections(1).Headers(1).Range _
     .Tables(1).Cell(2,1).Range.Text = strTextToInsert
End Sub
This would display a InputBox to get the title from the user, and then put that text into Cell(2,1) of a table in the Primary Header of Section 1.

Assuming of course such a table existed.

Or.....

You could have various header content which included graphics and text, and have them as AutoText named "Agenda", "RegionDirector". Again get what you want from the user...
Code:
Sub ByAutoText()
Dim strInsert As String
strInsert = InputBox("Title?")

ActiveDocument.AttachedTemplate.AutoTextEntries(strInsert).Insert _
    Where:=Sections(1).Headers(1).Range, RichText:=True
End Sub
So say they type in "Agenda" - no quotes - then (asssuming there IS an Autotext "Agenda") the Autotext entry "Agenda" gets inserted into the primary header of section 1.

That AutoText entry can be anything - a combination of graphics in table, with text...whatever you want.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top