I hope this isn't a double post, but the board kinda crashed when I hit
post...
Anyways, what you said sounds like what I want to do. Right now I have a
simple macro that prints out a document by section since all the documents
will be in a new section:
Private Sub <Document Name>_Click()
ActiveDocument.PrintOut Background:=True, Range:=wdPrintFromTo, From:="s11",
To:="s11", Copies:=1
End Sub
What I've run into is the sections that a document is in will change at a
later date. Right now the document is set up so that if someone wants to
print the SOP for PO Creation, they would go to the TOC, click on Financial
SOP's, which takes them to the table that lists all financial SOP's, (works
great with heading style BTW, thanks!) then scroll down to the SOP for PO
Creation which may be called SOP 300.xx.xx. That table lists title, owner,
create date, revised date, etc., and a print button so the user can print
that SOP without clicking to follow, seeing how many pages it's on, and
manually printing (I think some folks would end up printing out the whole
document instead of what they want) At a later date I will probably add a
section between the beginning of the document and that SOP in order to keep
the whole document list organized as we create additional SOP's, but that
will throw off the macro and make it print the document that is in the
previous section instead of the one that I want.
Right now all the documents have a heading at the top of the page (not IN
the header anymore) with a Heading Style, sub heading style, etc., and all
the headings will be unique with a name and number that won't change. Is
there a way to have a print button to print the section or pages occupied by
a document with a unique heading instead of just a static section reference?
I thought bookmarks was the way to go since I thought they would dynamically
update with inserting pages/sections, but you talked me out of it... Ideas?
Thanks.
Marty
macropod said:
Hi Marty,
Why don't you want to simply print the Section the Heading is in or, if a Heading relates to multiple Sections or you don't have
Section breaks between headings, all the pages from there until the next heading at the same level is encountered? That way, you
don't need to know beforehand how many pages there might be between headings. Your present approach doesn't seem to be very
flexible, implying that the document has to have a pre-defined number of pages for each table.
As for "multiple pages that have the same headers with fields and table references", I suggest you look at table heading rows and
STYLEREF fields.
--
Cheers
macropod
[Microsoft MVP - Word]
Ok, thanks for the tip. I've deleted my actual headers and blew out the top
margins since there will be multiple sections and will just link multiple
pages that have the same headers with fields and table references. I've
formatted the text in the new headers (which are now part of the body of the
document) with Heading styles so that I can have a TOC that feeds
automatically.
Now as for the data tables - I think I saw something on here about a macro
that could look for a specific heading and then print "X" number of pages
before and after. Since all the documents will have a specific number
identifying them (i.e. xxx.xx.xx) I shouldn't have any issues, is that
correct? Am I going in the right direction now?
Thanks for the help so far, much appreciated!!
Marty
:
Hi Marty D,
Is there a reason from building your TOC from bookmarks rather than Heading Styles? The bookmark approach takes a lot more
work
to
set up and maintain. Plus bookmarks are easily deleted by accident or extended into areas they shouldn't cover.
--
Cheers
macropod
[Microsoft MVP - Word]
Hello, I'm not sure if this is possible, but I would like to write a macro to
print out specific sections in my document using a bookmark instead of
section. Right now the document is only 30 pages or so, but will eventually
be 200 - 300. Each section is bookmarked to allow a TOC to hyperlink to it,
and I would like to have a Print button next to it so the end user can print
from the TOC. I have a macro now that prints the section, but since this book
is growing the section numbers will change as well. Once I get to the point
where I have 100+ sections, I may need to insert a new section in the middle
of the document which will cause the all the macros after that section to not
print correctly. Any ideas? Is it possible to rename sections so that they
won't update when a new section is inserted somewhere in the document?