Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Layout - Conditional Formatting MS Word 1

Status
Not open for further replies.

vjh

Technical User
Dec 14, 2002
46
0
0
CA
Hello all,

I have a document (in Word 2000) downloaded into a table from a client's mysql database. My client wants to reformat the entire thing (~600 pages) with three levels of headings which must appear on every page.

Here's what I need to appear on each page (and each of these has its own format which is controlled by styles in the template, not shown here)

Section Title
Subsection Title (Page Break required when it changes)
Sub - sub section Title (May be the same as Subsection Title Page break not required)

I've approached this by putting the items into the header, but am finding this very problematic. I need for the heading changes to appear only in the header and disappear from the content of the page. Is there a better way to do this?

And is there a way to get the page breaks in there automatically?

I appreciate any and all suggestions! Thanks in advance.

vjh
 





How about Table > Heading Rows Repeat?

Skip,
[sub]
[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue][/sub]
 
I should have explained better what my table looks like... because repeating the heading rows won't work

The table isn't a spreadsheet-like table, and the section titles aren't column titles. Mostly the 'table' has only a single (spanned) column, with two columns for the address and contact information.

7 Section Heading
SUBSECTION Heading

Sub-subsection Heading

Organization Name

Organization Address Details Phone: ### #####
Organization Address Detail2 Fax:

Long Description of the organization, people and services from a memo field in the database.
______________________________________________________

Organization 2

Organization Address Details Phone: ### #####
Organization Address Detail2 Fax:

Long Description of the organization, people and services from a memo field in the database.
_________________________________________________________
 



"Mostly the 'table' has only a single (spanned) column, with two columns for the address and contact information."

So then how do you know the organization, or whatever else is in your HEADERS that makes one record DIFFERENT that another???

Skip,
[sub]
[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue][/sub]
 
Thanks for trying to help with this, Skip.

The HEADERs are different levels of categories, as specified by the clients database, and the Organizations are grouped into the various categories. When the category changes, and new sub-sub-section name and possible sub-section name is generated. I could ask for changes to this db request, but that might take ages to get implemented...
 



So this...
[tt]
Section Heading
SUBSECTION Heading

Sub-subsection Heading

Organization Name

Organization Address Details Phone: ### #####
Organization Address Detail2 Fax:

Long Description of the organization, people and services from a memo field in the database.
______________________________________________________

Organization 2

Organization Address Details Phone: ### #####
Organization Address Detail2 Fax:

Long Description of the organization, people and services from a memo field in the database.
[/tt]
is how the QUERY returns data to Word?

Skip,
[sub]
[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue][/sub]
 




blank rows, lines and all?

Skip,
[sub]
[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue][/sub]
 
Uh-huh.

They set this up when they printed this a few years ago, and this is how they want to see it. It's a small non-profit that I'm volunteering for, and have inherited a number of quirky things from. Including this!

vjh
 



Seem to me that this may have to be dome with VBA code.

You must do something like this...

determine where the section breaks are, based on changes in the returned data. That data must be stripped from the resultset and placed in the header. Insert a Next Page SectionBreak.

Skip,
[sub]
[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue][/sub]
 
Please quit using "header" when you are talking about tables. Header is a very specific thing in Word, and it has nothing to do with tables.

" Mostly the 'table' has only a single (spanned) column, with two columns for the address and contact information. "

So you have merged cells, followed by unmerged cells?

Also, is this one table going on and on? If not, what determines the ending of one table, and the start of a new table?

"with three levels of headings which must appear on every page. "

This may be a problem, as "page" is a slippery thing in Word. Are the pages broken by actual page breaks? Section breaks?

faq219-2884

Gerry
My paintings and sculpture
 



Jerry,

This seems not to be A table. But it is not a very clear requirement.

Skip,
[sub]
[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue][/sub]
 
Sorry for being so confusing, a reflection of my state of mind on this.

In answer to fumei's comments:

[tt]Please quit using "header" when you are talking about tables. Header is a very specific thing in Word, and it has nothing to do with tables.[/tt]

I have actually been using "header" in the specific Word sense. The various levels of "headings", on the other hand, are essentially subsections that come from a database that I have been trying to get into the 'header' (and off the page content part).


[tt]So you have merged cells, followed by unmerged cells?[/tt]

Yes. I know this isn't a 'Table' in the Database or Spreadsheet sense of the word, it is what 'slippery' Word calls a Table. The unmerged cells are really a formatting device that as far as I can tell is only there to facilitate the two columns of the contact information which come from different database fields.


[tt]Also, is this one table going on and on? If not, what determines the ending of one table, and the start of a new table?[/tt]

It's all one table going on and on.


[tt]"with three levels of headings which must appear on every page." This may be a problem, as "page" is a slippery thing in Word. Are the pages broken by actual page breaks? Section breaks? [/tt]

When it comes into Word, there are no manual page or section breaks. My approach to put the headings into the headers was to deal with the slippery page problem. I've done this by inserting a StyleRef field into the header, but this has left me with the problem of having duplicate information (it's in the header and the page content itself.) So this isn't working.

I think Skip's suggestion for VBA code to strip the headings out of the page content and into the header would probably work, but I've no idea where to start with that! Should I go to the VBA forum for that?

Thanks again for helping!

 




Gerry is a Word guru. If anyone could suggest a good solution, it would be him.

Skip,
[sub]
[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue][/sub]
 
OK, I would disagree that you have used "header" in the specific Word sense:

"The HEADERs are different levels of categories, as specified by the clients database"

No, headers are not anything like that. Perhaps the header text content may be that...but headers are not.

OK, I am quibbling.

Bottom line? You have a problem. You are going to have to make some decisions. You can NOT have different text in the header for different pages across ~600 pages without using Section breaks. However, while a table can cross a PageBreak (and still be the same table), this does NOT apply for Section breaks. Tables can not span - as the same table - across a Section break.

"I think Skip's suggestion for VBA code to strip the headings out of the page content and into the header would probably work, but I've no idea where to start with that! Should I go to the VBA forum for that?"

Yes, probably. If what you want is the text content taken out of the page, and put into the header, AND that you are going to somehow logically determine Section breaks to get that, then I think it will require some processing, ie. VBA.

It is hard to say. Is it possible to see an example, say 30 pages of this? If it contains information that you do not wish others to see, could you make a mockup of what it would look like? As it stands, it will be a challenge, and you are definitely going to have to work out very very specific logic in determining what you are tranfering to the headers, as text.

If you have something I could look at, you can send it to me (ZIPped if possible please).

myhandle at telus dot net

I would be willing to take a look and possibly make suggestions.

faq219-2884

Gerry
My paintings and sculpture
 
Just to let others know....the OP has sent a sample file (37 pages) and.....

I think I am going to plotz. Aieeeee! Merged cells, merged with text, merged cells without text, text lines with terminating paragraph marks, text lines NOT terminating with paragraph marks...some "sub-headings" with a crucial followup line, some without....no styles...contact information sometimes using ^p, and sometimes not; using cell structure to separate...not using cell structure to separate.

I have succeeded in at least breaking it into good Sectioning (using VBA), and header text...but my goodness, I do not see how it will be possible to fully error trap things over ~600 pages. Hey, I trust my own abilities, but I would not trust any code solution to be 100%, even my own. This thing will need, regardless of ANY solution, a proper editor eyeball. Interesting challenge though, to try and see how far I can get this thing working.

Lordy, I hate merged cells!

faq219-2884

Gerry
My paintings and sculpture
 
Gerry has gone above and beyond on this one!

And I concur, the document is a nightmare. It's been giving me headaches for days.

... vj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top