How to align text left, center, right?

Discussion in 'Microsoft Word New Users' started by LurfysMa, Jun 25, 2006.

  1. LurfysMa

    LurfysMa Guest

    I have 3 fields in the footer of a template (name, title, date). The
    date is a date field. The name and title are custom document
    variables.

    I would like all 3 on the same line in the footer with the name left
    justified, the date right justified, and the title centered in the
    remaining space. The name may be short or quite long. Same with the
    title. Some examples:

    nnnnnnnn tttttttttt mm/dd/yy
    nnnnnnnnnnnnnnnnnnnnn ttttt mm/dd/yy
    nnnnnnn ttttttttttttttttttt mm/dd/yy

    Is there a way to do that?

    The document has 7-8 sections each with a different footer.

    What I have been doing is defining two tabs: one at the right margin
    and one about in the center. Then, after I set the document variables,
    I manually edit the footers in each section and adjust the center tab.

    Is there a way to do that automatically?

    Thanks

    --
    Running Word 2000 SP-3 on Windows 2000
     
    LurfysMa, Jun 25, 2006
    #1
    1. Advertisements

  2. Not with a variable pitch font.

    --
    Hope this helps.

    Please reply to the newsgroup unless you wish to avail yourself of my
    services on a paid consulting basis.

    Doug Robbins - Word MVP

    "LurfysMa" <> wrote in message
    news:...
    >I have 3 fields in the footer of a template (name, title, date). The
    > date is a date field. The name and title are custom document
    > variables.
    >
    > I would like all 3 on the same line in the footer with the name left
    > justified, the date right justified, and the title centered in the
    > remaining space. The name may be short or quite long. Same with the
    > title. Some examples:
    >
    > nnnnnnnn tttttttttt mm/dd/yy
    > nnnnnnnnnnnnnnnnnnnnn ttttt mm/dd/yy
    > nnnnnnn ttttttttttttttttttt mm/dd/yy
    >
    > Is there a way to do that?
    >
    > The document has 7-8 sections each with a different footer.
    >
    > What I have been doing is defining two tabs: one at the right margin
    > and one about in the center. Then, after I set the document variables,
    > I manually edit the footers in each section and adjust the center tab.
    >
    > Is there a way to do that automatically?
    >
    > Thanks
    >
    > --
    > Running Word 2000 SP-3 on Windows 2000
     
    Doug Robbins - Word MVP, Jun 25, 2006
    #2
    1. Advertisements

  3. There's a way to do this, but it's a bit finicking:

    1. Format the paragraph as Justified.

    2. Type the name. Use nonbreaking spaces between words. Follow the name with
    an ordinary space.

    3. Type the title, again using nonbreaking spaces internally and an ordinary
    space at the end.

    4. Type the date, again using nonbreaking spaces (if any).

    5. Press Shift+Enter.

    6. If the blank line thus produced causes a problem, select just the
    paragraph mark and format it as 1 point or Hidden.

    --
    Suzanne S. Barnhill
    Microsoft MVP (Word)
    Words into Type
    Fairhope, Alabama USA
    Word MVP FAQ site: http://word.mvps.org
    Email cannot be acknowledged; please post all follow-ups to the newsgroup so
    all may benefit.

    "LurfysMa" <> wrote in message
    news:...
    > I have 3 fields in the footer of a template (name, title, date). The
    > date is a date field. The name and title are custom document
    > variables.
    >
    > I would like all 3 on the same line in the footer with the name left
    > justified, the date right justified, and the title centered in the
    > remaining space. The name may be short or quite long. Same with the
    > title. Some examples:
    >
    > nnnnnnnn tttttttttt mm/dd/yy
    > nnnnnnnnnnnnnnnnnnnnn ttttt mm/dd/yy
    > nnnnnnn ttttttttttttttttttt mm/dd/yy
    >
    > Is there a way to do that?
    >
    > The document has 7-8 sections each with a different footer.
    >
    > What I have been doing is defining two tabs: one at the right margin
    > and one about in the center. Then, after I set the document variables,
    > I manually edit the footers in each section and adjust the center tab.
    >
    > Is there a way to do that automatically?
    >
    > Thanks
    >
    > --
    > Running Word 2000 SP-3 on Windows 2000
     
    Suzanne S. Barnhill, Jun 25, 2006
    #3
  4. LurfysMa

    LurfysMa Guest

    On Sun, 25 Jun 2006 17:27:55 +0200, "Doug Robbins - Word MVP"
    <> wrote:

    >Not with a variable pitch font.


    I infer that you are talking about a macro that could count the
    characters in the 3 fields and then divide the remaining soace
    equally, right?

    Not that I'm going to do this, but isn't there some VBA command that
    willr eturn the width of a text string in a given font and size?

    --
    Running Word 2000 SP-3 on Windows 2000
     
    LurfysMa, Jun 25, 2006
    #4
  5. LurfysMa

    LurfysMa Guest

    On Sun, 25 Jun 2006 10:51:51 -0500, "Suzanne S. Barnhill"
    <> wrote:

    >There's a way to do this, but it's a bit finicking:
    >
    >1. Format the paragraph as Justified.
    >
    >2. Type the name. Use nonbreaking spaces between words. Follow the name with
    >an ordinary space.
    >
    >3. Type the title, again using nonbreaking spaces internally and an ordinary
    >space at the end.
    >
    >4. Type the date, again using nonbreaking spaces (if any).
    >
    >5. Press Shift+Enter.
    >
    >6. If the blank line thus produced causes a problem, select just the
    >paragraph mark and format it as 1 point or Hidden.


    Now that's a clever solution. I'll fiddle around with it.

    Back in the "old days" on IBM mainframes, we used to have a word
    processor that has a "Split" command. You could enter two or more text
    strings separated by delimiters and the program would divide the
    available space evenly. This was a markup program (not wysiwyg) so we
    would imbed controls:

    ..foot on
    ..space 2
    ..split /String one/String two/String three/String four/
    ..foot off

    We used that one a lot.

    --
    Running Word 2000 SP-3 on Windows 2000
     
    LurfysMa, Jun 25, 2006
    #5
  6. LurfysMa

    Jay Freedman Guest

    On Sun, 25 Jun 2006 09:38:56 -0700, LurfysMa <>
    wrote:

    >On Sun, 25 Jun 2006 17:27:55 +0200, "Doug Robbins - Word MVP"
    ><> wrote:
    >
    >>Not with a variable pitch font.

    >
    >I infer that you are talking about a macro that could count the
    >characters in the 3 fields and then divide the remaining soace
    >equally, right?
    >
    >Not that I'm going to do this, but isn't there some VBA command that
    >willr eturn the width of a text string in a given font and size?


    For the record, no, VBA doesn't have any "how wide is this string"
    function that doesn't require inserting the string first. Its big
    brother VB does, as do the heavy-duty languages like C++ and C#, but
    VBA has always been without it. Where it is available, it's a fairly
    complicated procedure -- you have to get a graphic context (a memory
    area loaded with the properties of the current printer), create a font
    object, pass the string and the font object to the function and get
    back a width in pixels, convert that to the rendering width on the
    page, and finally release the font and context objects.

    The closest you can get in VBA is to insert the string in the document
    and then call
    Selection.Information(wdHorizontalPositionRelativeToTextBoundary),
    which returns the position of the cursor in points from the left
    margin.

    --
    Regards,
    Jay Freedman
    Microsoft Word MVP FAQ: http://word.mvps.org
    Email cannot be acknowledged; please post all follow-ups to the
    newsgroup so all may benefit.
     
    Jay Freedman, Jun 25, 2006
    #6
  7. And in those days, you used fixed width fonts and you knew exactly how many
    characters fitted onto one line.

    --
    Hope this helps.

    Please reply to the newsgroup unless you wish to avail yourself of my
    services on a paid consulting basis.

    Doug Robbins - Word MVP

    "LurfysMa" <> wrote in message
    news:...
    > On Sun, 25 Jun 2006 10:51:51 -0500, "Suzanne S. Barnhill"
    > <> wrote:
    >
    >>There's a way to do this, but it's a bit finicking:
    >>
    >>1. Format the paragraph as Justified.
    >>
    >>2. Type the name. Use nonbreaking spaces between words. Follow the name
    >>with
    >>an ordinary space.
    >>
    >>3. Type the title, again using nonbreaking spaces internally and an
    >>ordinary
    >>space at the end.
    >>
    >>4. Type the date, again using nonbreaking spaces (if any).
    >>
    >>5. Press Shift+Enter.
    >>
    >>6. If the blank line thus produced causes a problem, select just the
    >>paragraph mark and format it as 1 point or Hidden.

    >
    > Now that's a clever solution. I'll fiddle around with it.
    >
    > Back in the "old days" on IBM mainframes, we used to have a word
    > processor that has a "Split" command. You could enter two or more text
    > strings separated by delimiters and the program would divide the
    > available space evenly. This was a markup program (not wysiwyg) so we
    > would imbed controls:
    >
    > .foot on
    > .space 2
    > .split /String one/String two/String three/String four/
    > .foot off
    >
    > We used that one a lot.
    >
    > --
    > Running Word 2000 SP-3 on Windows 2000
     
    Doug Robbins - Word MVP, Jun 25, 2006
    #7
  8. LurfysMa

    LurfysMa Guest

    On Sun, 25 Jun 2006 22:08:55 +0200, "Doug Robbins - Word MVP"
    <> wrote:

    >And in those days, you used fixed width fonts and you knew exactly how many
    >characters fitted onto one line.


    You may be right. It's been so long. But I think we did have
    proportional space fonts as well.

    In any case, it would not be much harder for the word processor to do
    the "split" function with proportional space fonts than monospace. The
    work processor has to know "exactly how many characters will fit on a
    line" regardless.

    --
    Running Word 2000 SP-3 on Windows 2000
     
    LurfysMa, Jun 26, 2006
    #8
  9. LurfysMa

    Graham Mayor Guest

    Not so - each character will have a different width eg the letter i takes up
    less space than the letter w.

    iiiiiiiiii
    wwwwwwwwww

    The line wrap is set by a variety of factors not least of which is the
    current printer driver.

    Why make things unnecessarily difficult for yourself? Put a centre aligned
    tab at the centre of the page
    and a right aligned tab at the right margin. The texts will align to the
    page.

    --
    <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
    Graham Mayor - Word MVP

    My web site www.gmayor.com
    Word MVP web site http://word.mvps.org
    <>>< ><<> ><<> <>>< ><<> <>>< <>><<>

    LurfysMa wrote:
    > In any case, it would not be much harder for the word processor to do
    > the "split" function with proportional space fonts than monospace. The
    > work processor has to know "exactly how many characters will fit on a
    > line" regardless.
     
    Graham Mayor, Jun 26, 2006
    #9
  10. LurfysMa

    LurfysMa Guest

    On Mon, 26 Jun 2006 08:17:25 +0300, "Graham Mayor"
    <> wrote:

    >LurfysMa wrote:
    >> In any case, it would not be much harder for the word processor to do
    >> the "split" function with proportional space fonts than monospace. The
    >> work processor has to know "exactly how many characters will fit on a
    >> line" regardless.


    >Not so - each character will have a different width eg the letter i takes up
    >less space than the letter w.


    Of course. That's why it's a proportional font.

    But each character of each font includes information on its width. The
    WP knows how wide the line is and it knows how wide each character is
    and it can add and subtract. Nothing more is needed. If this weren't
    so, the WP would not be able to format lines.

    So, to do my split function, all that is needed is for the WP to add
    up the widths of the three text strings, subtract that from the line
    length, and divide by 2.

    >iiiiiiiiii
    >wwwwwwwwww
    >
    >The line wrap is set by a variety of factors not least of which is the
    >current printer driver.
    >
    >Why make things unnecessarily difficult for yourself? Put a centre aligned
    >tab at the centre of the page
    >and a right aligned tab at the right margin. The texts will align to the
    >page.


    That won't work. The left and center strings can be very short or very
    wide. That's the whole problem. The left string can be wider than half
    the line width. I don't want the middle string centered on the line
    width, I want it centered on the space between the right edge of te
    left string and the left edge of the right string.


    --
    Running Word 2000 SP-3 on Windows 2000
     
    LurfysMa, Jun 26, 2006
    #10
  11. LurfysMa

    Bob S Guest

    One scheme that might work, or at least be marginally easier, is to
    use a one-row three-column table in the footer.

    Make the table width 100% and turn off borders.

    Put in your field codes.

    Make the left column left aligned, drag the width small, and turn off
    text wrapping.

    Make the center column center aligned.

    Make the right column right aligned, drag the width small, and turn
    off text wrapping.

    If you are really lucky, when you later evaluate the fields the left
    and right table columns will expand to fit their contents and
    everything will work like magic. If you are less lucky at least you
    will only have to drag the column edges to make the left and right
    cells minimum size for their contents, which might be easier than
    trying to position the center tab stop.

    Bob S





    On Sun, 25 Jun 2006 07:29:59 -0700, LurfysMa wrote:

    >I have 3 fields in the footer of a template (name, title, date). The
    >date is a date field. The name and title are custom document
    >variables.
    >
    >I would like all 3 on the same line in the footer with the name left
    >justified, the date right justified, and the title centered in the
    >remaining space. The name may be short or quite long. Same with the
    >title. Some examples:
    >
    >nnnnnnnn tttttttttt mm/dd/yy
    >nnnnnnnnnnnnnnnnnnnnn ttttt mm/dd/yy
    >nnnnnnn ttttttttttttttttttt mm/dd/yy
    >
    >Is there a way to do that?
    >
    >The document has 7-8 sections each with a different footer.
    >
    >What I have been doing is defining two tabs: one at the right margin
    >and one about in the center. Then, after I set the document variables,
    >I manually edit the footers in each section and adjust the center tab.
    >
    >Is there a way to do that automatically?
    >
    >Thanks
     
    Bob S, Jul 26, 2006
    #11
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    Center Align Word tables

    Guest, Jan 5, 2005, in forum: Microsoft Word New Users
    Replies:
    2
    Views:
    168
    JBNewsGroup
    Jan 5, 2005
  2. Guest

    to right-align text with dot leaders

    Guest, Mar 7, 2005, in forum: Microsoft Word New Users
    Replies:
    1
    Views:
    1,023
    Jay Freedman
    Mar 7, 2005
  3. Pablo Suarez
    Replies:
    2
    Views:
    238
    CyberTaz
    Jun 7, 2008
  4. Jon

    Print layout view - align doc to left

    Jon, Jul 21, 2008, in forum: Microsoft Word New Users
    Replies:
    10
    Views:
    284
    Suzanne S. Barnhill
    Jul 22, 2008
  5. Rich Pasco

    Left, Center, and Right aligned text in same header

    Rich Pasco, Aug 7, 2008, in forum: Microsoft Word New Users
    Replies:
    6
    Views:
    3,596
    Graham Mayor
    Aug 10, 2008
Loading...

Share This Page