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