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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting problems after multiple documents merged and printed as one

Status
Not open for further replies.

cjkoontz

MIS
Aug 9, 2000
102
US
I have a macro in a Word 2000 document that does a few things (partly of which) --

* Creates a blank document.
Documents.Add

* Inserts between two and ten documents into it.
Selection.InsertFile FileName:=PlanCheckCoverDoc, Range:="", ConfirmConversions:=False, Link:=False, Attachment:=False
Selection.InsertBreak Type:=wdSectionBreakNextPage

* Insert page numbers.
With ActiveDocument.Sections(2).Footers(wdHeaderFooterPrimary)
.LinkToPrevious = False
.Range.Text = ""
.PageNumbers.Add
End With

* Finds and replaces any text, if necessary.
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
etc.
End With
Selection.Find.Execute Replace:=wdReplaceAll

* Prints the document.
ActiveDocument.ActiveWindow.PrintOut Background:=False

What should print is a cover letter with "correction" documents.

Each correction document can include a list of items that need correcting.

Each correction document should start with their own numbering.

The problem I'm having is this --

* Printed document ignores the initial format for header, footer, and border spacing.

* A succeeding correction document might have its numbering start where the preceding document left off.

Should I be specifying some sort of code beforehand to preserve the format from all the documents involved? If so, would love to know how.
 
Turns out that this problem had nothing to do with VBA.

It was a matter of the shared "styles" in use between multiple documents.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top