How can I print specfic sections of document based on table key?

W

WEC

I need to print only sections of a report that are marked Y (YES) or N (N0)
in a table in the report. How do I program to do this.
Thanks.
 
J

Jean-Guy Marcil

WEC was telling us:
WEC nous racontait que :
I need to print only sections of a report that are marked Y (YES) or
N (N0) in a table in the report. How do I program to do this.
Thanks.

Have each row in the summary table relate to its corresponding section:
Row 1 = Section 1
Row 2 = Section 2
etc.

Iterate the yes/no cells in the summary table, every time the cell
Range.Text value = Yes, store the row number in a string variable.

Build a string like: (If rows 2,4,6 and 7 are marked as "Yes")

myPrintRange = "s2,s4,s6,s7"

Use that string in the Print out method to specify the range to print:

ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Pages:=myPrintRange


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top