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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verticle alignment in Word 1

Status
Not open for further replies.

medic133

Technical User
Apr 7, 2002
86
US
I am trying to vary the verticle alignment of text on the same page of a Word 2002 document. I have attempted to do this by inserting continuous breaks at the end of each section and then setting the verticle alignment on the page setup tab to the appropriate alignment. However, it doesn't seem that my section breaks are having any effect because all of the sections are aligned the same. Essentially I would like to take the following three lines on one page and place them at the described verticle alignments on the page.

This line vertically aligned top.

This line vertically aligned center.

This line vertically aligned bottom.

Any ideas on what I'm doing wrong? Thanks in advance!
 
The method you are trying to use will not work. You are trying to make Word act like it is Quark Xpress. It is not.

You are using vertical text alignment under Page Setup. This is the clue. It is Page Setup. Have you checked what Vertical alignment - Center actually does? It centers the text relative to the page. You can not have conflicting assignment of this on the same page. You can not have some text vertically aligned Top, some Center, and some Bottom. Even if you do use continuous sections.

What if you put your text, but in this order?

This line vertically aligned bottom.
This line vertically aligned top.
This line vertically aligned center.

Do you see my point? I know you would likely not do that, but what if you did? How would Word interpret that? It is conflicting. A text line BELOW another is set to be alignment Top - which would make it before - but it is after, oh never mind? Word ignores conflicting vertical text alignments on the same page. Regardless of section breaks. Actually, that is not quite true. It does not ignore them, it accepts the first one.

Gerry
 
Gerry,

I do see now what you mean by PAGE setup and how my desires were conflicting. Is there any way of accomplishing what I'm wanting without placing paragraph marks (pushing the enter key some number of times) to force the proper placement? Something like text boxes or something in VBA? (I've noticed you can access the VB Editor from Word and, while I've used VBA in access, I can't even begin to think what application it would have in word.)

Thanks again for the explanation!
 
Possibly. Please explain. exactly, what it is you want. And why. Why do you need this? Could it be done differently? Better?

In theory what you seem to be asking for is a line of text that remains dynamically at the top, a line that remains dynamically in the middle etc. By dynamic I mean, if you added text to that line it would remain at Top (or centered).

Have you tried using styles? Word is designed, totally, around the use of styles. The whole idea of using extra paragraph marks to create space is against the design of Word. Most people do it that way, but Word is at its greatest when using styles properly.

So again, possibly. What precisely are you wanting to do?

Gerry
 
I am wondering if you might do something simple like putting in the lines of text... then highlighting the first two lines and then going to the indents and spacing (paragraph formatting) do spacing after as 290 or something that works. Keep a section break (new page) before and after this and keep lines together... don't know if that will work.
 
I use a text box to accomplish same. For Instance, my name, address and email on my resume are in text boxes placed exactly where I want them.

You can get to Text Box by turning on your Drawing Toolbar, if you are not familiar with the button on the Standard Toolbar, right click any toolbar, select Drawing.
The bar shows up on the bottom and Text box is the 7th or 8th button, it has an A and lines beside it.

IF the drawing canvas comes up, hit ESC before continuing, that way you can draw the box where you want it and move it as required.
 
Doroth

What you suggested is exactly what I want: text to remain dynamicly where I place them. My current purpose for this is in filling out a form in Word with several textboxes within it to be completed by myself, much like a contract. I have created a template for this and I would like the addressee's information to remain on top (name, address, etc.) as well as the letterhead and the body of the form to remain centered on the page regardless of the length of text placed in the textboxes. I must admit, I am totally ignorant about styles. I am an instructor and repeatedly use the same "format" (not referring to format in Word) for all of my exams, lecture notes, handouts, etc. Would styles allow me to be able to select a particular "format" (depending on whether I'm writing an exam or developing a lecture) and make this process much easier?

Thanks in advance!
 
GeoCan,

Thanks for the response. I'll try what I'm attempting to accomplish with textboxes. If you read my response to Doroth you can see that if the textbox won't "autoexpand" this may not work well for this particular application as I fill in textboxes with sometimes relatively lengthy text. However, I'll give it a try.

Thanks again.
 
1. If you are using consistent format (i.e look) then ABSOLUTELY you should use styles. Completely. Totally. It is the way to go. Used from templates, it is the real power behind Word.

2. You state that you want certain text to remain:

centered on the page regardless of the length of text placed in the textboxes

I do not see how you can do that. It will work until the text input into the text box gets big enough to push the other text down. And it will. Text takes up space (or number really, as Word assigns every character position as the distance from Position 0 - the start of the document. If you put enough text in your textboxes, they WILL move your centered text.

Now it is possible to dynamically reposition text, but you must clearly define your conditional needs.

Suppose the text input into the textboxes would potentially push the centered text down by 5 lines. Is that OK, is it small enough that you would accept that? Suppose it was 10 lines - would that be unacceptab;e? And if unacceptable, what do you want to do about it? Split up the text input into the text box? Put some before your "permanent" centered text, and some after?

What, precisely, are your needs?

Also, one last thought. When you say textbox...what kind of text box?

One of those floating Insert > TextBox things. Thse are badly named. Thye are essentially graphic placeholders - they even default to calling it a drawing canvas.

Or are you talking about FormField textboxes, using the Forms toolbar?

Or are you talking about ActiveX textboxes, using the Controls toolbar?

Makes a difference.

Gerry
 
I think I have an easy answer for you. Make a Table with three cells. You can format the table to fit on a page and to not show the borders. Pull the table to the right size then 'distribute cells evenly.' Then, format the cells so the first one is aligned top, middle one aligned center, and bottom one aligned bottom. I think this will get you where you want to go.

In addition, you can make each cell have a form field. Protect the document as a form, then you can just tab through to fill it out.

Good luck.
 
Doroth, you wrote:
You can format the table to fit on a page

Have you tried this? May I ask how you formatted (or would format) the table to fit the page? I can think of two ways.

1. push the cell size to a third of a page by adding paragraph marks.

2. push the cell size to a third of a page by adjusting the Before / After spacing of the paragraph in the cell

Either way, will certainly format a blank table to fit a page. However....

Either way, it will not work. I tried. In both cases, if the text input is lengthy, then, again, it will push any text following it down. Text takes up up real estate, there is just no way around it. Well, short of calculating the absolute position of the text you want to keep in location; accepting the input text, recalculating the absolute position, and if moved unacceptably, do something with the input text.

Again, I can see how you can make a table fit a page, put formfields in the appropriate cells...but what happens if you put in a lot of text? It moves the following text.

Gerry
 
Granted I don't know where the bulk of the information will be, but I just pulled the bottom of the table down and distributed the cells evenly using that option on the format tab. If the amount of text is always less at the beginning or end, it's possible to make those cells smaller... it really won't matter since the borders won't be shown. The thing that you are correct about is that this is not dynamic so that it changes as the needed space for those cells change. I feel like I saw some vba a while ago that would address this need, but I must admit I am no vba user.
 
Oh, it could be done with VBA. Sort of.

Determine the maximum length of text that can be inserted into the prior formfield, before the text you do not want to move, does move. The length can be calculated by using the Range object. Filling up the space to the maximum will let you know the cutoff for that line Range.Start:

ActiveDocument.Bookmarks("\line").Range.Start


Bring in the text - but first bring it to a blank location. I would make a temporary blank page at the end of the document. Dump the text there so you can calculate the length of it. Do both a word count, and an absolute measurement.

Calculate the Range.End of the formfield. Add the length of the incoming text. If it is greater than the position you calculated was the maximum for the non-moving text, split up the text.

In order to be able to take any overflow, I would make a hidden formfield AFTER the non-moving text. If it is required, make it visible, and fill with the overflow. If there is no overflow, keep it hidden.

This can be done. However, it is not what I would call beginners code. If there is a common possibility of a lot of text being input, i would go back and rethink the design of the document. There may be a better way.


Gerry
 
Thanks to all who have responded. You've all given me something to think about and play with. I'll continue to mess around with the styles as, again, this is something I have not used before. Thanks again!!
 
You can achive the desired outcome by putting the text into three frames instead of textboxes - one each positioned at the top, center and bottom of the page. All you need to do for each frame is to set the height property to auto, and they will expand/contract as text is added or deleted, all the while maintaining the correct positioning. You can have the top frame expand downwards only, the bottom frame expand upwards only and the center frame expand in both directions if you want. All you have to do is specify the position on the page that the frame is to use as its reference point.

The only significant problem you'll have to watch out for is that you could end up with the frames overlapping if you put too much text in. If that happens, you'll only see whatever is in the frame on top.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top