PC Review


Reply
Thread Tools Rate Thread

How to align text left, center, right?

 
 
LurfysMa
Guest
Posts: n/a
 
      25th Jun 2006
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
 
Reply With Quote
 
 
 
 
Doug Robbins - Word MVP
Guest
Posts: n/a
 
      25th Jun 2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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



 
Reply With Quote
 
 
 
 
Suzanne S. Barnhill
Guest
Posts: n/a
 
      25th Jun 2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
LurfysMa
Guest
Posts: n/a
 
      25th Jun 2006
On Sun, 25 Jun 2006 17:27:55 +0200, "Doug Robbins - Word MVP"
<(E-Mail Removed)> 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
 
Reply With Quote
 
LurfysMa
Guest
Posts: n/a
 
      25th Jun 2006
On Sun, 25 Jun 2006 10:51:51 -0500, "Suzanne S. Barnhill"
<(E-Mail Removed)> 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
 
Reply With Quote
 
Jay Freedman
Guest
Posts: n/a
 
      25th Jun 2006
On Sun, 25 Jun 2006 09:38:56 -0700, LurfysMa <(E-Mail Removed)>
wrote:

>On Sun, 25 Jun 2006 17:27:55 +0200, "Doug Robbins - Word MVP"
><(E-Mail Removed)> 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.
 
Reply With Quote
 
Doug Robbins - Word MVP
Guest
Posts: n/a
 
      25th Jun 2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Sun, 25 Jun 2006 10:51:51 -0500, "Suzanne S. Barnhill"
> <(E-Mail Removed)> 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



 
Reply With Quote
 
LurfysMa
Guest
Posts: n/a
 
      26th Jun 2006
On Sun, 25 Jun 2006 22:08:55 +0200, "Doug Robbins - Word MVP"
<(E-Mail Removed)> 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
 
Reply With Quote
 
Graham Mayor
Guest
Posts: n/a
 
      26th Jun 2006
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.



 
Reply With Quote
 
LurfysMa
Guest
Posts: n/a
 
      26th Jun 2006
On Mon, 26 Jun 2006 08:17:25 +0300, "Graham Mayor"
<(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I have 'align left' and 'align centre' on tool bar I need align ri Blue Shadow Microsoft Word Document Management 1 17th Dec 2007 08:30 PM
<div align=center> also affects align of dynamic dropdown item text Steve Richter Microsoft ASP .NET 1 24th Jun 2007 08:11 PM
How to right align text but left align lines on first character? =?Utf-8?B?bXNjZXJ0aWZpZWQ=?= Microsoft Word Document Management 1 10th Aug 2006 09:48 PM
What is short-Cut forleft align and Right align? =?Utf-8?B?U2FuZHk=?= Microsoft Excel Misc 1 24th Feb 2005 01:25 PM
how to Align text left & vertical align middle Kay Microsoft ASP .NET 2 25th Jul 2003 09:32 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:43 PM.