![]() |
#16
|
||||
|
||||
![]()
If you want a Directory merge, change:
.MainDocumentType = wdFormLetters to: .MainDocumentType = wdDirectory Do note, however, that means you'll lose your individual page headers & footers - a Directory merge can have only one of each. An alternative would be to perform a Letter merge (as per the current code), then delete the Section breaks post-merge. The outcome will be the same, though. You can do that by inserting the following code after .DisplayAlerts = True Code:
With .ActiveDocument If .Sections.Count > 1 Then For Each HdFt In .Sections(.Sections.Count).Headers If HdFt.Exists Then HdFt.Range.FormattedText = .Sections(1).Headers(HdFt.Index).Range.FormattedText HdFt.Range.Characters.Last.Delete End If Next For Each HdFt In .Sections(.Sections.Count).Footers If HdFt.Exists Then HdFt.Range.FormattedText = .Sections(1).Footers(HdFt.Index).Range.FormattedText HdFt.Range.Characters.Last.Delete End If Next End If Do While .Sections.Count > 1 .Sections(1).Range.Characters.Last.Delete DoEvents Loop .Range.Characters.Last.Delete End With The generation of duplicate reports suggests your code is being called twice.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sharing data between Office applications | mdavies | Office | 1 | 11-26-2013 02:55 PM |
![]() |
abreeden | Office | 1 | 05-18-2012 08:02 PM |
![]() |
RiverStyx | Office | 1 | 05-30-2011 08:31 PM |
Change skin color of applications? | Jack R | Office | 0 | 07-04-2010 04:25 AM |
How many Word applications are running GetObject | stevecarr | Word | 0 | 01-09-2006 07:41 AM |