|
-
Oct 14th, 2002, 02:36 PM
#1
Thread Starter
PowerPoster
Word automation - combining multiple docs into one (Workhorse?)
Hello there -
I have about 30 separate Word docs, each with their own margins, headers, footers and page numbering. What I need to do is combine these into one big Word doc, but have the individual formatting of the input docs preserved.
I have made some progress by inserting Continuous breaks at the beginning and Next Page breaks at the end of each doc, then doing an InsertFile on each one to compose the master doc. What does not happen is the preservation of the page numbering. I seem to get continuous page numbering in the master doc, no matter what I try.
At this point I'm taking stabs in the dark and could use some enlightenment on the best way to do this task.
Thanks,
Bruce
"It's cold gin time again ..."
Check out my website here.
-
Oct 14th, 2002, 06:41 PM
#2
Fanatic Member
Looks like you are on the right track. With headers, Word tries to "help" by guessing what you want--which is probably helpful for Word beginners, but is a bit of a pain for complex documents or VBA.
To stop continuous page numbering manually, you would select View then Header and Footer. Then unclick the Same as Previous button (this tells Word to not use the same header as the previous section), then click the Format Page Number button (hand pointing to pound sign) then change the selection from Continue from previous section to Start at and enter the starting page number for the section. In code, you can this this like:
VB Code:
' With primary header/footer for last section...
With ActiveDocument _
.Sections(ActiveDocument.Sections.count) _
.Headers(wdHeaderFooterPrimary)
' Don't link to header/footer from previous section.
.LinkToPrevious = False
' Start page numbering for section at 1.
With .PageNumbers
.RestartNumberingAtSection = True
.StartingNumber = 1
End With
End With
I think you just have to set the primary header/footer and not the others.
Instead of the next page section break, it might be better to do a continuous section break, then a regular page break and set the page numbering to start at zero. But, I'm not sure. Somtimes you have to play around a little to get the results you want.
-
Oct 14th, 2002, 08:32 PM
#3
Thread Starter
PowerPoster
Thanks, Workhorse, you are truly the Word integration guru.
"It's cold gin time again ..."
Check out my website here.
-
Oct 27th, 2002, 09:18 AM
#4
Thread Starter
PowerPoster
Well, the original problem is resolved, but it looks like I'm having related problems with "Styles" being inhereted from the previous document.
What statements can I use to totally obliterate any "influence" a previous document might have on the new document being inserted? What I really want is one master document that is really a bunch of independent documents stacked on top of one another, each with its original formatting, styles, etc. retained.
"It's cold gin time again ..."
Check out my website here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|