K
K J
I think I posted in a low-traffic group, so I'm going to cross-post
here, now that I've found the "traffic ratings" in Google Groups.
Thanks for your patience with this!
--PART 1--
I have to edit 4 similar-but-different documents at work so their
footers will all have "1/07" instead of "1/06" in the footer. "Easy,"
I thought, "I'll just replace the even page text & the odd page text
and I'll be done." Then I found out that because of section breaks in
the document, the "even page" & "odd page" footers start over every few
pages...and this is a 300-page document or something (times 4
documents).
Okay, that's not so bad...get into a footer, do a search & replace, and
I THINK that should be taken care of. (I haven't done it yet but soon
will try.)
Here's my big problem: the footers are divided into 3 columns of a
table. One on the left has that "Blah blah, (1/07)" text left-aligned.
A second in the middle has centered text that's just the page number.
And a third on the right has right-aligned text that says, "Blah blah
blah blah blah," but I need to add to it so it says, "New Extra Stuff
Blah blah blah blah blah." That doesn't fit on one line, though,
unless I mess with the width of the right column. And, of course, I
have to mess with the width of the left column, too, to make sure that
the left and right boundaries of the middle column stay centered around
the center of the page so that the centered text within it will be
centered on the page.
All this dragging--or perhaps a little faster, shortcut-keying through
editing 3 columns' worth of "column width," is REALLY annoying done
some hundred or so times per document, because each time I do it, the
change only repeats for a couple of pages.
Is there any way to either overwrite ALL footers with the same thing,
even spanning section breaks (because actually, the evens & odds in
this document are the same--it's just the headers that vary by
even/odd)?
OR
Is there any way to link all footers to previous, even spanning section
breaks, in a single action? (It is equally annoying to click "link to
previous" and hit enter through the messages some hundred or so times
per document.)
Thank you!
--PART 2--
Oh, and by the way, I tried making & running this macro and it changed
nothing in the later footers--no "1/06" to "1/07," no table column
widths...nothing.
Maybe they're all "linked" now, but my eyes tell me they sure ain't the
same yet.
(It does seem that page 2, which used to be blank, now has page 1's
content, but that after a section break, everything went back to same
old, same old--in other words, the "same as-ing" didn't SPAN section
breaks.)
Sub TurnOnFooterSameAsPrevious()
'
' link Macro
Dim sSection As Section
Dim fFooter As HeaderFooter
' Go to each section in the document.
For Each sSection In ActiveDocument.Sections
' Turns off "Same As Previous" in all Footers.
For Each fFooter In sSection.Footers
fFooter.LinkToPrevious = True
Next
Next sSection
End Sub
--PART 3--
Okay, this effort completely failed, too. It ran an infinite loop, and
when I hit "break" on my keyboard (which worked right away,
fortunately), nothing was different about column widths far down the
document.
I guess that means it got stuck somewhere in an early section.
Sub ChangeCellWidthsInAllSections()
Dim sSection As Section
Dim fFooter As HeaderFooter
' Go to each section in the document.
For Each sSection In ActiveDocument.Sections
' Changes the column widths in all footers.
For Each fFooter In sSection.Footers
Selection.Tables(1).Columns(1).Width =
InchesToPoints(2.94)
Selection.Tables(1).Columns(2).Width =
InchesToPoints(0.48)
Selection.Tables(1).Columns(3).Width =
InchesToPoints(3.24)
Next
Next sSection
End Sub
here, now that I've found the "traffic ratings" in Google Groups.
Thanks for your patience with this!
--PART 1--
I have to edit 4 similar-but-different documents at work so their
footers will all have "1/07" instead of "1/06" in the footer. "Easy,"
I thought, "I'll just replace the even page text & the odd page text
and I'll be done." Then I found out that because of section breaks in
the document, the "even page" & "odd page" footers start over every few
pages...and this is a 300-page document or something (times 4
documents).
Okay, that's not so bad...get into a footer, do a search & replace, and
I THINK that should be taken care of. (I haven't done it yet but soon
will try.)
Here's my big problem: the footers are divided into 3 columns of a
table. One on the left has that "Blah blah, (1/07)" text left-aligned.
A second in the middle has centered text that's just the page number.
And a third on the right has right-aligned text that says, "Blah blah
blah blah blah," but I need to add to it so it says, "New Extra Stuff
Blah blah blah blah blah." That doesn't fit on one line, though,
unless I mess with the width of the right column. And, of course, I
have to mess with the width of the left column, too, to make sure that
the left and right boundaries of the middle column stay centered around
the center of the page so that the centered text within it will be
centered on the page.
All this dragging--or perhaps a little faster, shortcut-keying through
editing 3 columns' worth of "column width," is REALLY annoying done
some hundred or so times per document, because each time I do it, the
change only repeats for a couple of pages.
Is there any way to either overwrite ALL footers with the same thing,
even spanning section breaks (because actually, the evens & odds in
this document are the same--it's just the headers that vary by
even/odd)?
OR
Is there any way to link all footers to previous, even spanning section
breaks, in a single action? (It is equally annoying to click "link to
previous" and hit enter through the messages some hundred or so times
per document.)
Thank you!
--PART 2--
Oh, and by the way, I tried making & running this macro and it changed
nothing in the later footers--no "1/06" to "1/07," no table column
widths...nothing.
Maybe they're all "linked" now, but my eyes tell me they sure ain't the
same yet.
(It does seem that page 2, which used to be blank, now has page 1's
content, but that after a section break, everything went back to same
old, same old--in other words, the "same as-ing" didn't SPAN section
breaks.)
Sub TurnOnFooterSameAsPrevious()
'
' link Macro
Dim sSection As Section
Dim fFooter As HeaderFooter
' Go to each section in the document.
For Each sSection In ActiveDocument.Sections
' Turns off "Same As Previous" in all Footers.
For Each fFooter In sSection.Footers
fFooter.LinkToPrevious = True
Next
Next sSection
End Sub
--PART 3--
Okay, this effort completely failed, too. It ran an infinite loop, and
when I hit "break" on my keyboard (which worked right away,
fortunately), nothing was different about column widths far down the
document.
I guess that means it got stuck somewhere in an early section.
Sub ChangeCellWidthsInAllSections()
Dim sSection As Section
Dim fFooter As HeaderFooter
' Go to each section in the document.
For Each sSection In ActiveDocument.Sections
' Changes the column widths in all footers.
For Each fFooter In sSection.Footers
Selection.Tables(1).Columns(1).Width =
InchesToPoints(2.94)
Selection.Tables(1).Columns(2).Width =
InchesToPoints(0.48)
Selection.Tables(1).Columns(3).Width =
InchesToPoints(3.24)
Next
Next sSection
End Sub