Reply
 
Thread Tools Display Modes
  #1   Report Post  
KR
 
Posts: n/a
Default Multiple alignments in Header/Footer? Then replicating in VBA

I need to automate the insertion of headers and footers and link it to a
macro or toolbar button. (insert text, then change the font and font size)

The header would include (left justified) the document name; and in the same
line have (right justified) the page X of Y
The footer would have 2 lines, starting with the path & filename then a
custom string entered by the user in an input box. (both could be left
justified, since they will be on separate lines).

I know a long time ago (I might not have even been using Word at the time,
to be honest) there were ways to have multiple justifications in
headers/footers. Now I either have to insert a Format Paragraph/Tabs/Bar
(which leaves an undesirable bar in the line) or mess with hovering over the
text until the cursor changes to various alignments.

Seems like there has to be a better way.... can anyone tell me how to insert
my text and do everything via the keyboard so my macro recorder records it
all?

Thanks!!
Keith


--
The enclosed questions or comments are entirely mine and don't represent the
thoughts, views, or policy of my employer. Any errors or omissions are my
own.


  #2   Report Post  
TF
 
Posts: n/a
Default

Keith

The first point to note is that Header and Footer are styles. If you format
the Header and Footer styles to use the correct font and have the correct
tabs, inserting this information is dead simple.

The second point is that as most of this information in the headers and
footers is consistent, you should create a template for saving the styles
and pre-entering the header and footer information. No need to resort to
messy macros for this.

Path, Filename, Page x of y are all fields that will update dynamically for
each new document you create from the template. The string can be added by
using the IncludeText field, so that too will be automated.

Template is the way to go. For help on templates, see Creating Templates -
The Basics parts 1 and 2 at http://word.mvps.org/Tutorials/index.htm

--
Terry Farrell - Word MVP
http://word.mvps.org/

"KR" wrote in message
...
:I need to automate the insertion of headers and footers and link it to a
: macro or toolbar button. (insert text, then change the font and font size)
:
: The header would include (left justified) the document name; and in the
same
: line have (right justified) the page X of Y
: The footer would have 2 lines, starting with the path & filename then a
: custom string entered by the user in an input box. (both could be left
: justified, since they will be on separate lines).
:
: I know a long time ago (I might not have even been using Word at the time,
: to be honest) there were ways to have multiple justifications in
: headers/footers. Now I either have to insert a Format Paragraph/Tabs/Bar
: (which leaves an undesirable bar in the line) or mess with hovering over
the
: text until the cursor changes to various alignments.
:
: Seems like there has to be a better way.... can anyone tell me how to
insert
: my text and do everything via the keyboard so my macro recorder records it
: all?
:
: Thanks!!
: Keith
:
:
: --
: The enclosed questions or comments are entirely mine and don't represent
the
: thoughts, views, or policy of my employer. Any errors or omissions are my
: own.
:
:


  #3   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default

As Terry implies, the Header and Footer styles have built-in tab stops to
facilitate what you want to do (a centered tab stop in the center of the
line, a right-aligned tab stop at the right margin). You can insert other
tabs as needed, but the bar tab is not the type you want; see
http://word.mvps.org/FAQs/Formatting/SettingTabs.htm.

Once you have the information you need in a document, save it as a template
(.dot file) for reuse--no macros required.

--
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.

"KR" wrote in message
...
I need to automate the insertion of headers and footers and link it to a
macro or toolbar button. (insert text, then change the font and font size)

The header would include (left justified) the document name; and in the

same
line have (right justified) the page X of Y
The footer would have 2 lines, starting with the path & filename then a
custom string entered by the user in an input box. (both could be left
justified, since they will be on separate lines).

I know a long time ago (I might not have even been using Word at the time,
to be honest) there were ways to have multiple justifications in
headers/footers. Now I either have to insert a Format Paragraph/Tabs/Bar
(which leaves an undesirable bar in the line) or mess with hovering over

the
text until the cursor changes to various alignments.

Seems like there has to be a better way.... can anyone tell me how to

insert
my text and do everything via the keyboard so my macro recorder records it
all?

Thanks!!
Keith


--
The enclosed questions or comments are entirely mine and don't represent

the
thoughts, views, or policy of my employer. Any errors or omissions are my
own.



  #4   Report Post  
KR
 
Posts: n/a
Default

Thank you both, I will definitely take a look at styles and the MVP page.
The reason I was looking to macros is because our department doesn't do a
good job of document control, and I wanted to be able to give everyone the
ability to "click a button" and have the header and footer auto-populate
with things like the path/filename, page numbers, date last updated, and
other things- on documents that they just created, or things that they are
opening from other sources... I was also going to link it to an inputbox (or
small userform) because the only piece of information that can't be
automated is the "expiration date" of the document. I thought that if I set
it all up and made it an add-in on everyone's machines, that I'd have to use
VBA to at least allow the inputbox, and possibly to deal with different
documents, on different machines. The easier I make it for them to use, the
more likely they will actually use it...


"Suzanne S. Barnhill" wrote in message
...
As Terry implies, the Header and Footer styles have built-in tab stops to
facilitate what you want to do (a centered tab stop in the center of the
line, a right-aligned tab stop at the right margin). You can insert other
tabs as needed, but the bar tab is not the type you want; see
http://word.mvps.org/FAQs/Formatting/SettingTabs.htm.

Once you have the information you need in a document, save it as a

template
(.dot file) for reuse--no macros required.

--
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.

"KR" wrote in message
...
I need to automate the insertion of headers and footers and link it to a
macro or toolbar button. (insert text, then change the font and font

size)

The header would include (left justified) the document name; and in the

same
line have (right justified) the page X of Y
The footer would have 2 lines, starting with the path & filename then a
custom string entered by the user in an input box. (both could be left
justified, since they will be on separate lines).

I know a long time ago (I might not have even been using Word at the

time,
to be honest) there were ways to have multiple justifications in
headers/footers. Now I either have to insert a Format Paragraph/Tabs/Bar
(which leaves an undesirable bar in the line) or mess with hovering over

the
text until the cursor changes to various alignments.

Seems like there has to be a better way.... can anyone tell me how to

insert
my text and do everything via the keyboard so my macro recorder records

it
all?

Thanks!!
Keith


--
The enclosed questions or comments are entirely mine and don't represent

the
thoughts, views, or policy of my employer. Any errors or omissions are

my
own.





Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is the header/footer sometimes missing? No Spam Please New Users 5 February 10th 05 01:20 AM
Multiple styles in a single paragraph skibikegolf Microsoft Word Help 1 January 5th 05 09:57 AM
Multiple docs open multiple words Ron Smith New Users 2 December 11th 04 09:21 PM
Word Attachments open multiple copies of Word rocketman60 Microsoft Word Help 1 December 11th 04 08:06 AM
Multiple Alignments on the Same Line JMJ1964 Page Layout 1 December 2nd 04 06:05 PM


All times are GMT +1. The time now is 07:50 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"