Results 1 to 13 of 13
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    centre a text box?

    Is there an easy way (Word97SR2) to centre a text box on the page? I was hoping for something along the lines of Format, Paragraph , Indents, Alignment = Centre.

    Of course I could always write a macro (attached) but there has to be an easier way, right?

    In the meantime, how do I make the frame autofit the text? I notice that as I type text and tap the ENTER key, the text drops through the bottom of the frame. The text appears to scroll inside the frame. I'd like a method to re-size the textbox in the vertical sense to accommodate my extra lines of text.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: centre a text box?

    Chris,

    A text box is just like a drawing object, so you select you text box, Click the Draw button on you Drawing Toolbar, select Align & distribute. Most options will be most likely be greyed out, but relative to Page should be Ok, so select it. Then repeat and all the other options should now be available. Select Align Center and Align Middle and you should have one text box in the middle of you page.

    cheers,

    Andrew

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: centre a text box?

    Oh darn! And I had such fun writing the macro!

    Thanks for the tip. I'm now busily exploring the Drawing Toolbar!

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: centre a text box?

    Hi Chris:
    1. Display the drawing toolbar.
    2. Click the edge of your text box to select it or click the select arrow on the drawing toolbar & then encircle the textbox.
    3. On the drawing toolbar, click draw/align or distribute/ & then use align center & align middle.

    That should do it. Glad to help.

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: centre a text box?

    Hi again,

    Actually a better way to align the box might be use Format | Text Box and select Advanced. You can then set Horizontal and Vertical positioning relative to the page. It has the advantage of allowing you to de-select Moving with Text, which means it will retain it's position regardless of any text manipulation.

    There is always more than one way to do things.

    BTW why the <font color=red>x</font color=red> instead of your likeness.

    AC

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: centre a text box?

    Thanks for the response. Is there a way to get the box to auto-adjust to the amount of text within the box? It seems like the sort of thing MS would have done.

    I have a fragmented personality, I guess.

  7. #7
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: centre a text box?

    Chris,

    This may not be relevant, but that is the default behavior of text boxes in PowerPoint - plus you have the option to turn that on or off.

    I don't think this behavior is available in Word (unless you want to write a macro that does it!

    (Intercept the insert textbox command to add code to initialize a SelectionChange Event class (Word 2000 only). The class keeps track of both the textbox's height as well as (somehow) the height of the text in it, and dynamically adjusts the height of the textbox to fit the text.) (But how to turn it off when you're not in a textbox?)[img]/w3timages/icons/nuts.gif[/img]

  8. #8
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Like so..

    Chris,

    Here is a quick and dirty demo of the concept. It could be made a lot smoother but suffices as a demo.

    By the way this serves as a good demonstration of a use of a class module (the basic info for implementing the event class came from Help - search on "WindowSelectionChange Event").

    Open the attached document and run the "RegisterEventClass" macro. Then try clicking insertion points (i.e. changing the selection) in the document. Nothing will happen. Now type additional text into the text box and continue until the bottom line completely disappears below the bottom of the textbox. Click anywhere back in the textbox and the textbox will resize vertically (cool!).

    Be sure when you're done, to run the "UnRegisterEventClass" macro.

    Have fun!

    Gary
    Attached Files Attached Files

  9. #9
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: But only in Word 2000!

    Don't try to run the code in the previous post in anything earlier than Word 2000 - you will probably get an error! Sorry.....

  10. #10
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: centre a text box?

    Chris, If you don not mind converting your Text Box to a Frame you can achieve auto re-sizing simply by formatting.

    In the Format Frame dialog you can set position relative to page, Center for both Vertical & Horizontal in your case, then select Auto for both Height & Width in the size settings.

    You can play around with these settings to get exactly what you want.

    I don't think there is a way to place a frame "behind text" like you can with a Text box, but if it contains text I expect you would not want it behind other text.

    It's a workaround that might work for you, since Gary's macro is not suitable for Word 97


    Andrew C

  11. #11
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: centre a text box?

    Gary, thanks. When I saw your post with code I *figured* it was Word2000!

    Andrew, thanks. Converting to a frame does the trick.

    Why was I using a textBox in the first place?

    Can you (or anyone else) suggest an advantage of using a TextBox over a frame?

    I seem to recall that Frames were all the rage back in Word6.

  12. #12
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Text Box V Frames

    Chris,

    with the exception of AutoSize, Text boxes are the best bet for most cases. They can be treated as a Drawing Object, (you can apply colour, shape, rotations etc) , They can be placed behind the main text (Water Marking, graphic effects) and Text can flow from one frame to another if linked. They also seem to have more Text Wrapping options.

    However I think that Frames have the edge when it comes to inserting Fields - text boxes do not handle them or at least not all of them.

    They both have their uses - start off with a Text Box and if you run into difficulties it is easy to convert to frame. I am sure that others have encountered problems using both text Boxes and Frames so perhaps a debate will ensue.

    Andrew

  13. #13
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Box V Frames

    >Start off with a Text Box and if you run into difficulties it is easy to convert to frame.

    Andrew, thanks for the advice and this little gem.

    It's often a matter of determining the way that's going to be best 90% of the time and getting on with life rather than struggling with awkwardness of an inapproipriate way.

    It's Text Boxes for me (he said, filing away Andrew's post for future reference)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •